Skip to content

Conversation

@simonguo
Copy link
Member

This pull request updates the useMessages function in src/toaster/ToastContainer.tsx to ensure state updates are based on the previous state, improving reliability when handling asynchronous updates.

State management improvements:

  • Updated the setMessages call to use a functional state update in the setTimeout for clearing all messages. This ensures the state update is based on the most recent state.
  • Updated the setMessages call to use a functional state update when filtering visible messages. This prevents potential issues caused by stale state references.

@codesandbox
Copy link

codesandbox bot commented May 23, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link

vercel bot commented May 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rsuite-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2025 1:23am
rsuite-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2025 1:23am

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@codecov
Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.20%. Comparing base (6e39ebf) to head (ec87c13).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4294   +/-   ##
=======================================
  Coverage   89.20%   89.20%           
=======================================
  Files         525      525           
  Lines       12520    12539   +19     
  Branches     3212     3216    +4     
=======================================
+ Hits        11168    11185   +17     
  Misses        677      677           
- Partials      675      677    +2     
Flag Coverage Δ
ChromeCi 89.14% <100.00%> (+<0.01%) ⬆️
Firefox 89.11% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@simonguo simonguo merged commit 3279371 into main May 23, 2025
16 checks passed
@simonguo simonguo deleted the fix-toaster-stale-closure-4291 branch May 23, 2025 01:27
@simonguo
Copy link
Member Author

fix: #4291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants