You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: do not clear dialog state immediately on useDialog unmount (#2584)
### 🎯 Goal
When the `useDialog` hook's component unmounts, it immediately clears
dialog state in an effect cleanup. However, in some situations an effect
cleanup can run even if the hook's component is still mounted and
effect's dependencies didn't change - e.g., when `<StrictMode />` is
enabled.
So it's safer to keep dialog state for a short time after cleanup runs.
### 🛠 Implementation details
Instead of immediately removing dialog state, it's marked to be removed
after a short timeout. Referencing the dialog again quick cancels state
removal.
Fixes#2583.
0 commit comments