NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4295 most downloaded on npm
👻 Primitive and flexible state management for React
Last release 5 days ago
29 Sep 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
214 releases · first in 2020
One column per quarter.
Now, useAtomDevtools in jotai/devtools supports read-only atoms. You can only see the read-only atom values in Redux DevTools Extention (you can't cha
Now, useAtomDevtools in jotai/devtools supports read-only atoms. You can only see the read-only atom values in Redux DevTools Extention (you can't change the value, like with time-traveling.)
Full Changelog: https://github.com/pmndrs/jotai/compare/v1.4.2...v1.4.3
v1.4.1 has a bug in atomWithStorage types in jotai/utils, which is fixed in v1.4.2.
v1.4.1 has a bug in atomWithStorage types in jotai/utils, which is fixed in v1.4.2.
Full Changelog: https://github.com/pmndrs/jotai/compare/v1.4.1...v1.4.2
This adds a new experimental support for React Refresh. It has some other small fixes and improvements.
This adds a new experimental support for React Refresh. It has some other small fixes and improvements.
Full Changelog: https://github.com/pmndrs/jotai/compare/v1.4.0...v1.4.1
fix(core): no async write suspense (BREAKING CHANGE in behavior) by @dai-shi in https://github.com/pmndrs/jotai/pull/731
Previously, sync atom and async atom are not distinguishable by types. This is improved now. If you make types inferred, there would be no changes required. If you explicitly type async atoms, migration would be required.
Previously, when you annotate atom() to create a writable atom, it looks like this:
const atom1 = atom(0)
const atom2 = atom<number, number>(
(get) => get(atom1),
async (get, set, arg) => set(atom1, arg),
)
☝️ That will be type error.
A fix would be adding the 3rd type arg:
const atom2 = atom<number, number, Promise<void>>(
(get) => get(atom1),
async (get, set, arg) => set(atom1, arg),
)
But, the recommendation is not to annotate atom() types, but arg only:
const atom2 = atom(
(get) => get(atom1),
async (get, set, arg: number) => set(atom1, arg),
)
Previously, async (read) atoms are typed like this:
const atom3 = atom<number>(async (get) => get(atom1))
☝️ That will not work.
A fix would be annotate it with Promsie<Value>:
const atom3 = atom<Promise<number>>(async (get) => get(atom1))
But, the recommendation is not to annotate atom() types, but to infer types:
const atom3 = atom(async (get) => get(atom1))
Suspending on write turns out to be a bit of trouble. We should use promises. If you depend on this behavior, you might need to do something.
Previously, an async write atom suspends (triggers Suspense fallback):
const atom1 = atom(null, async (get, set, arg) => {
// async task
})
☝️ That will not suspend any longer.
We should instead have a loading flag.
const pendingAtom = atom(false)
const atom1 = atom(null, async (get, set, arg) => {
set(pendingAtom, true)
// async task
set(pendingAtom, false) // or put in finally clause
})
Full Changelog: https://github.com/pmndrs/jotai/compare/v1.3.9...v1.4.0
There was an edge-case issue with async atoms reported #751, which is fixed. Other changes are basically refactoring, but they may fix some potential
There was an edge-case issue with async atoms reported #751, which is fixed. Other changes are basically refactoring, but they may fix some potential bugs.
Full Changelog: https://github.com/pmndrs/jotai/compare/v1.3.8...v1.3.9
the old signature (serialize/deserialize functions) is deprecated and will be remove in the next version
jotai/utilsatomWithHash takes options object for more customization
serialize/deserialize functions) is deprecated and will be remove in the next versionjotai/valtioatomWithProxy takes options object for enable sync optionv1.3.4-1.3.6 accidentally requires newer node.js versions. v1.3.7 fixes it by reverting exports format. This also fixes handling async atoms with chai
v1.3.4-1.3.6 accidentally requires newer node.js versions. v1.3.7 fixes it by reverting exports format. This also fixes handling async atoms with chained dependency, which solves some cases.
⚠️ Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0
⚠️ Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0
This fixes a false positive warning in some environments reported in #709. It also comes with some refactoring for more code maintainability.
⚠️ Minimum requirements for Node.js (for server-side usage like Next.js): v14.13.0, v12.20.0
⚠️ Minimum requirements for Node.js (for server-side usage like Next.js): v14.13.0, v12.20.0
v1.3.4 requires node >= 14 in package.json, which may cause some issues in certain envs. As we don't require it, this reverts back to node >= 12. This also adds babel preset in jotai/babel.
⚠️ Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0
⚠️ Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0
jotaijotai/utilsloadable util which allows to avoid using <Suspense>jotai/babel.debugLabel to atom configs
Previously, writing atom returns always void, but this was troublesome when a derived atom has a custom write function which returns a promise. Now, i
jotaiPreviously, writing atom returns always void, but this was troublesome when a derived atom has a custom write function which returns a promise. Now, it returns a promise if write returns a promise.
There was an issue in v1.3.1 with regard to CJS/ESM exports. Please use v1.3.2 instead.
There was an issue in v1.3.1 with regard to CJS/ESM exports. Please use v1.3.2 instead.
This changed the exports config to match with nodejs standard. If you experience some issues with your bundlers feel free to open issues to report the
This changed the exports config to match with nodejs standard. If you experience some issues with your bundlers feel free to open issues to report them.
jotai/corejotai/* bundles accordingly.jotai/queryenabled option (Previously, it wasn't working properly)jotai/urqlpause optionreexecute callbackAs it falls back to the previous behavior, the core is not breaking. (However, other jotai/* has breaking changes in atom scope handling.)
jotaiWe fixed atom scope feature. useAtom now takes optional scope in the second argument and atom.scope is deprecated. As it falls back to the previous behavior, the core is not breaking. (However, other jotai/* has breaking changes in atom scope handling.)
jotai/utilsuseHydrateAtoms hook to restore atom values in render.waitForAll and useAtomCallback.v1.2.1 has an issue with TypeScript in jotai/utils, which is fixed.
v1.2.1 has an issue with TypeScript in jotai/utils, which is fixed.
React.FC from the TSX fileimport typev1.2.0 introduced jotai/rxjs, but because atomWithObservable can be implemented library-agnostic, it's moved to jotai/utils. [BREAKING] jotai/rxjs bun
v1.2.0 introduced jotai/rxjs, but because atomWithObservable can be implemented library-agnostic, it's moved to jotai/utils. [BREAKING] jotai/rxjs bundle is removed.
[BREAKING] Dropped equalityFn in atomWithQuery and atomWithInfiniteQuery
jotai/queryequalityFn in atomWithQuery and atomWithInfiniteQuerygetQueryClient for custom query client.initialDatajotai/rxjsAdded "import" export entries for modern bundlers.
atomWithInfiniteQuery in jotai/query.selectAtom and splitAtom in jotai/utils.Added a new function atomWithInfiniteQuery
jotai/queryatomWithInfiniteQueryFixed Provider's initialValues handling in DEV
jotai (dev only)jotai/devtoolsjotai/utilsatomWithStorage for React Native AsyncStoragejotai/queryatomWithQuery error handlingThis version adds a new bundle jotai/urql, an integration for urql, a GraphQL client.
This version adds a new bundle jotai/urql, an integration for urql, a GraphQL client.
jotai/utilsREFRESH symbol in atomWithDefault in favor of common RESET symboljotai/queryjotai/xstatejotai/urqlAdded _experimental_ unstable_promise option in get in atom write
jotaiunstable_promise option in get in atom writejotai/utilsatomWithStorage and improved it with subscribe optionatomWithDefault with "REFRESH" capabilitysplitAtom in edge use casesWe are pleased to announce jotai v1 release! Jotai is a primitive and flexible state management library for React.
We are pleased to announce jotai v1 release! Jotai is a primitive and flexible state management library for React.
Demos:
Jotai's atoms can be used like useState, but it's global state.
const yearAtom = atom(2021)
const Component = () => {
const [year, setYear] = useAtom(yearAtom)
return <>{year} <button onClick={() => setYear((c) => c + 1)}>Next</button></>
}
You can create a derived atom with read function.
const meterAtom = atom(1000)
const kilometerAtom = atom((get) => get(meterAtom) / 1000)
Jotai core jotai exposes only two functions atom, useAtom and one optional component Provider.
We have more functions in separate bundles jotai/*, such as jotai/utils and jotai/devtools.
For example, those include atomWithStorage, atomWithReset, atomFamily, to name a few.
They are all implemented with the public api of jotai core.
So, you can also create a similar third-party library.
Jotai comes with Suspense support. If your read function is async, it will suspend behind the scenes, and you wouldn't need to care async state in your code.
const idAtom = atom('id001')
const dataAtom = atom(async (get) => {
const response = await fetch(`.../${id}`)
return response.json()
}
const Component = () => {
const [data] = useAtom(dataAtom)
return <>{data.title} - {data.author}</>
}
We use the undocumented behavior of "Suspense for Lazy Loading" for any async. "Suspense for Data Fetching" is still to be finalized. Hence, this feature is technically unstable. We try our best to keep the API when it migrates.
Jotai comes with various integrations. Some of them are complete, some are preliminary.
jotai/immer: immer integrationjotai/optics: optics-ts integrationjotai/query: react-query integrationjotai/xstate: xstate integrationjotai/valtio: valtio integrationjotai/zustand: zustand integrationjotai/redux: redux integrationThe core API should be stable for React 16.8 and above. All major issues are resolved, and if there is a bug by chance, we will fix it as soon as possible.
We will be adding more utility functions on top of core, and your use cases would be important. Free free to open a new discussion.
We are already working on new integrations for urql and rxjs. We have a plan to work on dedicated integration for nextjs.
When React releases a new version with Suspense and Concurrent support, we will start working on the next major version. Our hope is to keep the API compatible.
We follow semantic versioning for core jotai.
Note that type-only changes and sub bundles jotai/* don't strictly follow the semver.
Please check release notes for details.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →