Omnistac / zedux

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

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

Closed bowheart closed 9 months ago

bowheart commented 9 months 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.