v1.5.1 has an issue accidentally in non-browser environment like Next.js and React Native. This should fix it.
What's Changed
- fix(utils): atomWithStorage should deal with no localStorage by @dai-shi in #951
- fix(babel): Require that atom is in module scope for react refresh by @Thisen in #952
Full Changelog: v1.5.1...v1.5.2