timolins / react-hot-toast

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

migrate: useSyncExternalStore instead of useState at useStore #358

Open yunho1017 opened 6 months ago

yunho1017 commented 6 months 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 6 months 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 6 months 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.