-
Notifications
You must be signed in to change notification settings - Fork 115
Fix global duration not work(Also includes some other attributes) #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix global duration not work(Also includes some other attributes) #365
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次修改在 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant N as useNotification
participant M as memoShareConfig
U->>N: 调用 open() 方法传入自定义配置
N->>M: 获取 memoized shareConfig(依赖更新时重新计算)
N->>N: 合并 memoized shareConfig 与传入配置
N-->>U: 展示通知(基于合并后的配置)
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/hooks/useNotification.tsxOops! Something went wrong! :( ESLint: 7.32.0 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs[email protected]/node_modules/@umijs/fabric/dist/eslint.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. tests/index.test.tsxOops! Something went wrong! :( ESLint: 7.32.0 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs[email protected]/node_modules/@umijs/fabric/dist/eslint.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (3)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #365 +/- ##
=======================================
Coverage 99.74% 99.74%
=======================================
Files 7 7
Lines 773 781 +8
Branches 125 126 +1
=======================================
+ Hits 771 779 +8
Misses 2 2 ☔ View full report in Codecov by Sentry. |
antd 引入新版本rc-notification的pr还需要提么 |
先发个patch再看需要。 |
// memorized shareConfig | ||
const { closeIcon, closable, duration, showProgress, pauseOnHover } = shareConfig; | ||
const memoShareConfig = React.useMemo<typeof shareConfig>(() => { | ||
return { | ||
...shareConfig, | ||
}; | ||
}, [closeIcon, closable, duration, showProgress, pauseOnHover]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closable 类型可以是一个对象,感觉会破坏memo,这里修复方案我感觉可以直接用 rc-util 的 useEvent 就好了。 万金油。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样啊,那有这个hook最好了,又探索到了😀
…eact-component#365) * fix: some properties changed by useState are not work * test: add test (cherry picked from commit d315300)
Co-authored-by: Ryan <[email protected]> fix: global duration not work(Also includes some other attributes) (#365)
This pr related to ant-design#52816
Summary by CodeRabbit