timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.44k stars 309 forks source link

migrate: useSyncExternalStore instead of useState at useStore #358

Open yunho1017 opened 1 month ago

yunho1017 commented 1 month ago

As-is

useStore Hook is adding a listener in useEffect to update state.

To-be

Changed to use useSyncExternalStore. After react18, ConcurrentFeature can cause a Tearing problem in the External Store. UseSyncExternalStore to fix this problem.

vercel[bot] commented 1 month ago

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

Name Status Preview Comments Updated (UTC)
react-hot-toast ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 8:26am
vercel[bot] commented 1 month ago

@yunho1017 is attempting to deploy a commit to the analytics-billing-vtest314 Team on Vercel.

A member of the Team first needs to authorize it.