fix: notification memory leak#361
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更改涉及将 Changes
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional comments not posted (3)
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #361 +/- ##
=======================================
Coverage 99.73% 99.73%
=======================================
Files 7 7
Lines 759 759
Branches 124 124
=======================================
Hits 757 757
Misses 2 2 ☔ View full report in Codecov by Sentry. |
|
130行未被用例覆盖 |
|
|
||
| const dictRef = useRef<Record<string, HTMLDivElement>>({}); | ||
| const [latestNotice, setLatestNotice] = useState<HTMLDivElement>(null); | ||
| const latestNoticeRef = useRef<HTMLDivElement>(null); |
There was a problem hiding this comment.
state 换成 ref 在 concurrent 下容易出问题,应该尽量以 effect 里配对做 state 更新。
Description
当使用stack时 notification会造成内存泄漏
Visuals
修改前的dom节点:

修改后的dom节点:

Checklist
Any TODOs?
A summary of any remaining work required to complete the requirements of the task.
Summary by CodeRabbit