Jotai Versions Save

👻 Primitive and flexible state management for React

v2.8.0

1 week ago

This version introduces a new feature atomWithLazy and deprecates useReducerAtom and freezeAtomCreator. It also introduces an experimental store implementation in jotai/experimental.

Migration Guide

selectAtom

selectAtom will no longer internally unwrap promises. To migrate to the new api, use the unwrap utility from jotai/utils package.

// suppose we have this
const baseAtom = atom(Promise.resolve({ id: 0, name: 'test' }))

// previously selectAtom would internally unwrap promises.
const idAtom = selectAtom(
  baseAtom,
  ({ name }) => name,
  (prev, curr) => prev.id === curr.id
)

// instead, you need to import `unwrap` from 'jotai/utils' and pass the unwrapped atom 
import { unwrap } from 'jotai/utils'
  ...
const idAtom = selectAtom(
  unwrap(baseAtom),
  ({ name }) => name,
  (prev, curr) => prev.id === curr.id
)

useReducerAtom

https://jotai.org/docs/recipes/use-reducer-atom

freezeAtomCreator

https://jotai.org/docs/guides/debugging#freezeatomcreator

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.7.2...v2.8.0

v2.7.2

3 weeks ago

Mostly refactors.

What's Changed

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.7.1...v2.7.2

v2.7.1

1 month ago

This fixes a regression in v2.7.0.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.7.0...v2.7.1

v2.7.0

1 month ago

We've improved the use of WeakMap for better memory management. Please report to us if any regressions are found.

What's Changed

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.6.5...v2.7.0

v2.6.5

1 month ago

Some type improvements!

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.6.4...v2.6.5

v2.6.4

2 months ago

Performance improvement! Check it out!

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.6.3...v2.6.4

v2.6.3

2 months ago

Some improvements in core and utils 👏

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.6.2...v2.6.3

v2.6.2

3 months ago

Some improvements for atomWithStorage. Feedback is welcome.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.6.1...v2.6.2

v2.6.1

3 months ago

This version has two minor improvements for library authors. It's wonderful to see Jotai ecosystem growing. No major bugs have been reported lately. It's fairly okay to say the current version is pretty stable.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.6.0...v2.6.1

v2.6.0

4 months ago

We can now directly use <Provider> in React Server Components. 🎉

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.5.1...v2.6.0