Since React 19 resolves the big issue that has made Zedux's useAtomSelector hook so complex in the past, Zedux v1.3.0 and v2.0.0 (and all future versions) will technically drop support for React versions prior to 19.
Using Zedux in older versions will technically work, so we aren't labeling this as a breaking change or waiting till Zedux v2. However, it will be susceptible to a memory "leak" when using useAtomSelector. This isn't a real leak since Zedux gives you full control over the cache. This means you can set up e.g. an interval that regularly destroys cached selectors that have no dependents. For example:
You're also free to not use selectors - they're optional in Zedux. Use ions instead until you can upgrade to React 19.
In older React versions, Zedux will also now be unable to determine a user-friendly name for graph pseudo-nodes created for React components. This doesn't break anything, it's just slightly worse DX. This is because React changed the name of their "internals" object in React 19. Since it isn't a big deal, we'd rather not lose perf by checking for the existence of all possible internals keys or build size by including both big strings.
While circumventing the "leak" is possible, it's still recommended to wait to upgrade Zedux until you upgrade to React 19.
Description
Since React 19 resolves the big issue that has made Zedux's
useAtomSelector
hook so complex in the past, Zedux v1.3.0 and v2.0.0 (and all future versions) will technically drop support for React versions prior to 19.Using Zedux in older versions will technically work, so we aren't labeling this as a breaking change or waiting till Zedux v2. However, it will be susceptible to a memory "leak" when using
useAtomSelector
. This isn't a real leak since Zedux gives you full control over the cache. This means you can set up e.g. an interval that regularly destroys cached selectors that have no dependents. For example:You're also free to not use selectors - they're optional in Zedux. Use ions instead until you can upgrade to React 19.
In older React versions, Zedux will also now be unable to determine a user-friendly name for graph pseudo-nodes created for React components. This doesn't break anything, it's just slightly worse DX. This is because React changed the name of their "internals" object in React 19. Since it isn't a big deal, we'd rather not lose perf by checking for the existence of all possible internals keys or build size by including both big strings.
While circumventing the "leak" is possible, it's still recommended to wait to upgrade Zedux until you upgrade to React 19.