Your Custom Hooks Tear in React 18. `useSyncExternalStore` Fixes It.
DEV Community
Your Custom Hooks Tear in React 18. `useSyncExternalStore` Fixes It.
A useState + useEffect hook that subscribes to window size, localStorage, or a WebSocket looks fine until React 18's concurrent rendering shows two parts of your UI two different values at once. useSyncExternalStore is the hook built to stop that.
0 comments
No comments yet.