With React 18 there is a new useSyncExternalStore hook (and a shim for >= 16.8) to properly subscribe to values in stores.
reactwg/react-18#86
Other projects like react-redux are moving to it (PR reduxjs/react-redux#1808 ) so might provide some benefits / need for custom subscription/memoization/scheduling.
With React 18 there is a new
useSyncExternalStorehook (and a shim for >= 16.8) to properly subscribe to values in stores.reactwg/react-18#86
Other projects like
react-reduxare moving to it (PR reduxjs/react-redux#1808 ) so might provide some benefits / need for custom subscription/memoization/scheduling.