* fix getSnapshot warning when a selector returns NaN useSyncExternalStoreWithSelector delegate a selector as getSnapshot of useSyncExternalStore. * Fiber's use sync external store has a same issue * Small nits We use Object.is to check whether the snapshot value has been updated, so we should also use it to check whether the value is cached. Co-authored-by: Andrew Clark <git@andrewclark.io> |
||
|---|---|---|
| .. | ||
| npm | ||
| shim | ||
| src | ||
| README.md | ||
| index.js | ||
| package.json | ||
| with-selector.js | ||
README.md
use-sync-external-store
Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.
Until useSyncExternalStore is documented, refer to https://github.com/reactwg/react-18/discussions/86