JO

Jotai

jotai

👻 Primitive and flexible state management for React

State Management
react
state
manager
management
recoil
store
jotai
State Management
javascript
npm
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB

Installation

npm install jotai

Code example

import { atom, useAtom } from "jotai";

const countAtom = atom(0);

export function Example() {
  const [count, setCount] = useAtom(countAtom);
  return (
    <button type="button" onClick={() => setCount((c) => c + 1)}>
      Count: {count}
    </button>
  );
}

Pros & cons

Pros

  • Actively maintained by Daishi Kato
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 0 open issues on GitHub

FAQs

Alternatives & similar libraries