atlassian / react-sweet-state

Shared state management solution for React
https://atlassian.github.io/react-sweet-state/
MIT License
871 stars 55 forks source link

Evaluate move to useSyncExternalStore #148

Closed albertogasparin closed 2 years ago

albertogasparin commented 3 years ago

With React 18 there is a new useSyncExternalStore hook (and a shim for >= 16.8) to properly subscribe to values in stores.

https://github.com/reactwg/react-18/discussions/86

Other projects like react-redux are moving to it (PR https://github.com/reduxjs/react-redux/pull/1808 ) so might provide some benefits / need for custom subscription/memoization/scheduling.