Omnistac / zedux

:zap: A Molecular State Engine for React
https://Omnistac.github.io/zedux/
MIT License
376 stars 7 forks source link

fix(react): handle unstable inline selector results in `useAtomSelector` #88

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

The recent useAtomSelector changes to move off of useSyncExternalStore for #83 introduced a bug with inline atom selectors that return referentially unstable results on every run. Handle that case specifically and add tests - one for strict mode on, one for strict mode off.