# React state management libraries

React state management libraries hold shared state that components can read without passing props through every level of the component tree. Components use hooks to subscribe to selected store or atom values, where a change to a subscribed value triggers a re-render. These libraries keep data such as the signed-in user or a shopping cart in one place, where every screen of an app reads the same value.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [Zustand](#zustand) | 351.6M | 58.9K | Nov 2026 | MIT |
| [Redux Toolkit](#redux-toolkit) | 186.4M | 11.2K | Nov 2026 | MIT |
| [TanStack Store](#tanstack-react-store) | 139.0M | 916 | Sep 2026 | MIT |
| [Nano Stores](#nanostores) | 76.6M | 7.6K | Oct 2026 | MIT |
| [Jotai](#jotai) | 36.9M | 21.3K | Nov 2026 | MIT |
| [XState](#xstate) | 31.2M | 30.5K | Nov 2026 | MIT |
| [MobX](#mobx) | 17.7M | 28.2K | Nov 2026 | MIT |
| [Valtio](#valtio) | 12.2M | 10.2K | May 2026 | MIT |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[Zustand](#zustand) has the most monthly downloads in this comparison, at 346.8M.

## Capabilities

| Library | Direct mutable observables | Statechart runtime |
| --- | --- | --- |
| [Zustand](#zustand) | No | No |
| [Redux Toolkit](#redux-toolkit) | No | No |
| [TanStack Store](#tanstack-react-store) | No | No |
| [Nano Stores](#nanostores) | No | No |
| [Jotai](#jotai) | No | No |
| [XState](#xstate) | No | Yes |
| [MobX](#mobx) | Yes | No |
| [Valtio](#valtio) | Yes | No |

## Libraries

### Zustand

[GitHub](https://github.com/pmndrs/zustand) · [npm](https://www.npmjs.com/package/zustand) · [Docs](https://zustand.docs.pmnd.rs/getting-started/introduction)

Zustand keeps application state in a store created by `create`, and the store itself is a React hook. A component calls the hook with a selector, such as `(state) => state.bears`, and renders again only when that selected value changes. No provider component wraps the app, and one store holds plain values, objects, and the functions that update them. Those functions call `set`, which merges the new values into the existing state one level deep.

- Downloads / mo: 351.6M
- Stars: 58.9K
- Last release: 5.1.0
- License: MIT
- Capabilities: [From the Zustand docs](https://zustand.docs.pmnd.rs/getting-started/introduction)

**Strengths**

- **Reads state without provider wrappers.** Read shared state through hooks without wrapping components in a provider.
- **Persists state with bundled middleware.** Save selected store data to synchronous or asynchronous storage.

**Watch out for**

- **Updates only merge one level.** Copy nested objects explicitly when changing values inside them.

```sh
npm install zustand
```

**xyflow/xyflow** (39.1K stars)

[xyflow/xyflow](https://github.com/xyflow/xyflow) 

```typescript
async function resolveFitView() {
      const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get();

      if (!panZoom) {
        return;
      }

      await fitViewport(
        {
          nodes: nodeLookup,
          width,
          height,
          panZoom,
          minZoom,
          maxZoom,
        },
        fitViewOptions
      );

      fitViewResolver?.resolve(true);
      /**
       * wait for the fitViewport to resolve before deleting the resolver,
       * we want to reuse the old resolver if the user calls fitView again in the mean time
       */
      set({ fitViewResolver: null });
    }

```

[packages/react/src/store/index.ts](https://github.com/xyflow/xyflow/blob/1bc405cd113618c17fd181b931a9fe573bec9fee/packages/react/src/store/index.ts#L56-L81) · [More projects using Zustand →](https://dashboard.exa.ai/playground/search?q=React%20projects%20that%20use%20zustand&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { create } from 'zustand'

const useBearStore = create((set) => ({
  bears: 0,
  increasePopulation: () => set((state) => ({ bears: state.bears + 1 })),
  removeAllBears: () => set({ bears: 0 }),
}))

function BearCounter() {
  const bears = useBearStore((state) => state.bears)
  return <h1>{bears} around here ...</h1>
}

function Controls() {
  const increasePopulation = useBearStore((state) => state.increasePopulation)
  return <button onClick={increasePopulation}>one up</button>
}

```

From [README.md](https://api.github.com/repos/pmndrs/zustand/contents/README.md)

### Redux Toolkit

[GitHub](https://github.com/reduxjs/redux-toolkit) · [npm](https://www.npmjs.com/package/@reduxjs/toolkit) · [Docs](https://redux-toolkit.js.org/)

Redux Toolkit is the official package for writing Redux logic, and it replaces most of the setup that plain Redux needs. `configureStore` creates the store, and `createSlice` takes an initial state and a set of reducer functions and generates the matching action creators. Data from a server goes through RTK Query, a layer built into the package that handles requests, caching, loading state, and refetching. React apps also install React Redux, which the official templates configure alongside it.

- Downloads / mo: 186.4M
- Stars: 11.2K
- Last release: 2.14.0
- License: MIT
- Capabilities: [From the Redux Toolkit docs](https://redux-toolkit.js.org/)

**Strengths**

- **Includes request caching.** Use RTK Query for loading, caching, invalidation, and refetching.
- **Generates reducers and action creators.** Generate matching reducers and actions from a slice definition.

**Watch out for**

- **State values should be serializable.** Keep functions and other non-serializable values outside Redux state.
- **Persistence needs an additional package.** Add a persistence library to save state across page reloads.

```sh
npm install @reduxjs/toolkit
```

**ProtonMail/WebClients** (5.7K stars)

[ProtonMail/WebClients](https://github.com/ProtonMail/WebClients) 

```typescript
export const createAsyncModelThunk = <Returned, State, Extra, ThunkArg = void>(
    prefix: string,
    {
        expiry,
        miss,
        previous,
    }: {
        expiry?: number;
        miss: (extra: {
            dispatch: ThunkDispatch<State, Extra, Action>;
            getState: () => State;
            extraArgument: Extra;
            options?: ThunkOptions<ThunkArg>;
        }) => Promise<Returned>;
        previous: (extra: {
            dispatch: ThunkDispatch<State, Extra, Action>;
            getState: () => State;
            extraArgument: Extra;
            options?: ThunkOptions<ThunkArg>;
        }) => ReducerValue<Returned> | undefined;
    }
) => {
    const pending = createAction(`${prefix}/pending`, () => ({
        payload: undefined,
    }));

    const fulfilled = createAction(`${prefix}/fulfilled`, (payload: Returned) => ({
        payload,
    }));

    const rejected = createAction(`${prefix}/failed`, (payload: any) => ({
        payload,
    }));

    const promiseStore = createPromiseStore<Returned>();

    const thunk = (
        options?: ThunkOptions<ThunkArg>
    ): ThunkAction<
        Promise<Returned>,
        State,
        Extra,
        ReturnType<typeof pending> | ReturnType<typeof fulfilled> | ReturnType<typeof rejected>
    > => {
        return (dispatch, getState, extraArgument) => {
            const select = () => {
                return previous({ dispatch, getState, extraArgument, options });
            };
            const cb = async () => {
                try {
                    dispatch(pending());
                    const value = await miss({ dispatch, getState, extraArgument, options });
                    dispatch(fulfilled(value));
                    return value;
                } catch (error) {
                    dispatch(rejected(miniSerializeError(error)));
                    throw error;
                }
            };
            return cacheHelper({ store: promiseStore, select, cb, cache: options?.cache, expiry });
        };
    };

    return {
        pending,
        fulfilled,
        rejected,
        thunk,
    };
};

```

[packages/redux-utilities/asyncModelThunk/creator.ts](https://github.com/ProtonMail/WebClients/blob/6ff1096a068ace81ea24a591b7ed8df98ff64db5/packages/redux-utilities/asyncModelThunk/creator.ts#L9-L78) · [More projects using Redux Toolkit →](https://dashboard.exa.ai/playground/search?q=React%20projects%20that%20use%20%40reduxjs/toolkit&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { createSlice, configureStore } from '@reduxjs/toolkit';

const counter = createSlice({
  name: 'counter',
  initialState: { value: 0 },
  reducers: {
    incremented(state) {
      state.value += 1;
    },
  },
});
const store = configureStore({ reducer: counter.reducer });
store.dispatch(counter.actions.incremented());
console.log(store.getState().value);

```

From [GettingStarted.md](https://api.github.com/repos/reduxjs/redux/contents/docs/introduction/GettingStarted.md)

### TanStack Store

[GitHub](https://github.com/TanStack/store) · [npm](https://www.npmjs.com/package/@tanstack/react-store) · [Docs](https://tanstack.com/store/latest/docs/framework/react/quick-start)

TanStack Store is an immutable, reactive data store that sits at the core of the other TanStack libraries. `createStore` defines the state, often outside any component, and `setState` replaces it with an updated copy. In React, `useSelector` reads one part of the store, and the component renders again only when that part changes. Adapters for Solid, Vue, Angular, and Svelte share the same store code.

- Downloads / mo: 139.0M
- Stars: 916
- Last release: 0.11.2
- License: MIT
- Capabilities: [From the TanStack Store docs](https://tanstack.com/store/latest/docs/framework/react/quick-start)

**Strengths**

- **Selector-scoped renders.** A component that reads one field with `useSelector` skips renders caused by other fields.

**Watch out for**

- **Renamed read hook.** `useStore` remains only as a deprecated alias for `useSelector`, which new code calls instead.

```sh
npm install @tanstack/react-store
```

**TanStack/router** (15.3K stars)

[TanStack/router](https://github.com/TanStack/router) 

```typescript
export function useRouterState<
  TRouter extends AnyRouter = RegisteredRouter,
  TSelected = unknown,
  TStructuralSharing extends boolean = boolean,
>(
  opts?: UseRouterStateOptions<TRouter, TSelected, TStructuralSharing>,
): UseRouterStateResult<TRouter, TSelected> {
  const contextRouter = useRouter<TRouter>({
    warn: opts?.router === undefined,
  })
  const router = opts?.router || contextRouter

  // During SSR we render exactly once and do not need reactivity.
  // Avoid subscribing to the store (and any structural sharing work) on the server.
  // The expression must stay inlined in the `if` so bundlers fold the
  // browser-build constant `isServer = false` and drop this server block.
  if (isServer ?? router.isServer) {
    const state = router.stores.__store.get() as RouterState<
      TRouter['routeTree']
    >
    return (opts?.select ? opts.select(state) : state) as UseRouterStateResult<
      TRouter,
      TSelected
    >
  }

  // eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
  return useSelector(
    router.stores.__store,
    // eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
    useStructuralSharing(opts, router),
  ) as UseRouterStateResult<TRouter, TSelected>
}

```

[packages/react-router/src/useRouterState.tsx](https://github.com/TanStack/router/blob/0b6d4f3f6b42e704555d9ff0014ddbf8b44f8e09/packages/react-router/src/useRouterState.tsx#L45-L77) · [More projects using TanStack Store →](https://dashboard.exa.ai/playground/search?q=%40tanstack/react-store%20GitHub%20projects)

**Quickstart**

```typescript
import { createStore, useSelector } from "@tanstack/react-store";

// You can instantiate the store outside of React components too!
export const store = createStore({
  dogs: 0,
  cats: 0,
});

// This will only re-render when `state[animal]` changes. If an unrelated store property changes, it won't re-render
const Display = ({ animal }) => {
  const count = useSelector(store, (state) => state[animal]);
  return <div>{`${animal}: ${count}`}</div>;
};

const updateState = (animal) => {
  store.setState((state) => {
    return {
      ...state,
      [animal]: state[animal] + 1,
    };
  });
};

```

From [quick-start](https://tanstack.com/store/latest/docs/framework/react/quick-start)

### Nano Stores

[GitHub](https://github.com/nanostores/nanostores) · [npm](https://www.npmjs.com/package/nanostores) · [Docs](https://github.com/nanostores/nanostores#readme)

Nano Stores builds state from many small stores that live in plain modules outside components. An `atom` holds one value, read with `get` and changed with `set`, and `computed` derives a new store from others, such as the admins filtered from a list of users. Adapter packages, such as `@nanostores/react`, connect the same stores to React, Preact, Vue, Svelte, Solid, Lit, and Angular. The core has zero dependencies and stays under one kilobyte, minified and compressed.

- Downloads / mo: 76.6M
- Stars: 7.6K
- Last release: 1.5.5
- License: MIT
- Capabilities: [From the Nano Stores docs](https://github.com/nanostores/nanostores#readme)

**Strengths**

- **Shared across frameworks.** One set of stores serves components written in React, Vue, Svelte, and other frameworks through small adapters.

```sh
npm install nanostores
```

**withastro/docs** (1.7K stars)

[withastro/docs](https://github.com/withastro/docs) 

```typescript
export function addCartItem({ id, name, imageSrc }: ItemDisplayInfo) {
    const existingEntry = cartItems.get()[id];
    if (existingEntry) {
      cartItems.setKey(id, {
        ...existingEntry,
        quantity: existingEntry.quantity + 1,
      });
    } else {
      cartItems.setKey(
        id,
        { id, name, imageSrc, quantity: 1 }
      );
    }
  }

```

[src/content/docs/en/recipes/sharing-state-islands.mdx](https://github.com/withastro/docs/blob/697d16abd26476628cf0bf7b932a8920c768720b/src/content/docs/en/recipes/sharing-state-islands.mdx#L396-L409) · [More projects using Nano Stores →](https://dashboard.exa.ai/playground/search?q=nanostores%20GitHub%20projects)

**Quickstart**

```typescript
import { atom } from 'nanostores'

export const $counter = atom(0)

$counter.set($counter.get() + 1)

```

From [README.md](https://api.github.com/repos/nanostores/nanostores/contents/README.md)

### Jotai

[GitHub](https://github.com/pmndrs/jotai) · [npm](https://www.npmjs.com/package/jotai) · [Docs](https://jotai.org/)

Jotai stores state as atoms, each created by `atom` with an initial value such as a string, number, object, or array. Inside a component, `useAtom` returns the value and a setter, the same pair that `useState` returns. Passing a read function to `atom` creates a derived atom whose value comes from other atoms, and that function can be async to load data. Code refers to atoms as objects, with no string keys, unlike Recoil.

- Downloads / mo: 36.9M
- Stars: 21.3K
- Last release: 3.0.2
- License: MIT
- Capabilities: [From the Jotai docs](https://jotai.org/)

**Strengths**

- **Derives values from other atoms.** Combine existing state values into values calculated from them.
- **Persists individual state values.** Use atomWithStorage to save selected values across browser reloads.

**Watch out for**

- **Atoms need stable references.** Reuse atom objects across renders to avoid infinite render loops.
- **Stored values can mismatch HTML.** Render storage-dependent content after browser state has loaded.

```sh
npm install jotai
```

**excalidraw/excalidraw** (135.9K stars)

[excalidraw/excalidraw](https://github.com/excalidraw/excalidraw) 

```typescript
export const useAtomWithInitialValue = <
  T extends unknown,
  A extends PrimitiveAtom<T>,
>(
  atom: A,
  initialValue: T | (() => T),
) => {
  const [value, setValue] = useAtom(atom);

  useLayoutEffect(() => {
    if (typeof initialValue === "function") {
      // @ts-ignore
      setValue(initialValue());
    } else {
      setValue(initialValue);
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);

  return [value, setValue] as const;
};

```

[excalidraw-app/app-jotai.ts](https://github.com/excalidraw/excalidraw/blob/82190fb28f58070b34b4017e70c0e2e83701a8e3/excalidraw-app/app-jotai.ts#L17-L37) · [More projects using Jotai →](https://dashboard.exa.ai/playground/search?q=React%20projects%20that%20use%20jotai&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { atom, useAtom } from 'jotai'

// Create your atoms and derivatives
const textAtom = atom('hello')
const uppercaseAtom = atom((get) => get(textAtom).toUpperCase())

// Use them anywhere in your app
const Input = () => {
  const [text, setText] = useAtom(textAtom)
  return <input value={text} onChange={(e) => setText(e.target.value)} />
}

const Uppercase = () => {
  const [uppercase] = useAtom(uppercaseAtom)
  return <div>Uppercase: {uppercase}</div>
}

// Now you have the components
const MyApp = () => (
  <div>
    <Input />
    <Uppercase />
  </div>
)

```

From [App.tsx](https://api.github.com/repos/pmndrs/jotai/contents/examples/hello/src/App.tsx)

### XState

[GitHub](https://github.com/statelyai/xstate) · [npm](https://www.npmjs.com/package/xstate) · [Docs](https://stately.ai/docs)

XState models application logic as state machines and statecharts: named states, the events that move between them, and actors that run them. `createMachine` defines the states and transitions, `createActor` starts an actor from that definition, and `send` delivers an event such as `{ type: 'play' }`. The package has no runtime dependencies and runs in frontend and backend code. For a plain store without machines, the same project publishes `@xstate/store`.

- Downloads / mo: 31.2M
- Stars: 30.5K
- Last release: 5.33.4
- License: MIT
- Capabilities: [From the XState docs](https://stately.ai/docs)

**Strengths**

- **Visual editor.** Stately Studio draws machines as diagrams and edits them visually.

**Watch out for**

- **Beta in the quick start.** The README's quick start installs `xstate@beta`, the next major version, rather than the current stable release.

```sh
npm install xstate
```

**processone/fluux-messenger** (450 stars)

[processone/fluux-messenger](https://github.com/processone/fluux-messenger) 

```typescript
private sendMachineEvent(event: ConnectionMachineEvent, source: string): void {
    const before = this.getMachineState()
    this.connectionActor.send(event)
    const after = this.getMachineState()
    const beforeText = JSON.stringify(before)
    const afterText = JSON.stringify(after)
    const message = `Machine event ${event.type} from ${source}: ${beforeText} -> ${afterText}`
    this.logTrace(message)
  }

```

[packages/fluux-sdk/src/core/modules/Connection.ts](https://github.com/processone/fluux-messenger/blob/583459002bde4f21cbb53a3556d81b7bf2a5b7c6/packages/fluux-sdk/src/core/modules/Connection.ts#L362-L370) · [More projects using XState →](https://dashboard.exa.ai/playground/search?q=xstate%20GitHub%20projects)

**Quickstart**

```typescript
import { createActor, createMachine } from 'xstate';

const playerMachine = createMachine({
  initial: 'stopped',
  states: {
    stopped: {
      on: { play: { target: 'playing' } }
    },
    playing: {
      on: {
        pause: { target: 'paused' },
        stop: { target: 'stopped' }
      }
    },
    paused: {
      on: {
        play: { target: 'playing' },
        stop: { target: 'stopped' }
      }
    }
  }
});

const player = createActor(playerMachine).start();

player.send({ type: 'play' });
console.log(player.getSnapshot().value); // 'playing'

```

From [README.md](https://github.com/statelyai/xstate/blob/main/README.md)

### MobX

[GitHub](https://github.com/mobxjs/mobx) · [npm](https://www.npmjs.com/package/mobx) · [Docs](https://mobx.js.org/)

MobX tracks which observable values each computation reads, so a React component wrapped in `observer` renders again only when those values change. `makeAutoObservable` turns an object's fields into observable state and its methods into actions. Updates are ordinary assignments, made from event handlers, timers, or asynchronous code. Derived values, called computeds, stay cached until the observables they read change. The state lives outside any UI framework, and the React bindings ship in the separate `mobx-react-lite` package.

- Downloads / mo: 17.7M
- Stars: 28.2K
- Last release: 7.1.7
- License: MIT
- Capabilities: [From the MobX docs](https://mobx.js.org/)

**Strengths**

- **Tracks component dependencies automatically.** Update React components when the state they read changes.
- **Caches values derived from state.** Cache calculated values until the state they read changes.

**Watch out for**

- **Async updates need action wrappers.** Wrap state changes after await in runInAction.

```sh
npm install mobx
```

**getsentry/sentry** (45.8K stars)

[getsentry/sentry](https://github.com/getsentry/sentry) 

```typescript
resetForm() {
    this.fields.clear();
    this.errors.clear();
    this.fieldState.clear();
    this.snapshots = [];
    this.initialData = {};
  }

```

[static/app/components/forms/model.tsx](https://github.com/getsentry/sentry/blob/78812b4aef3dffe91ebf058268ddc73ffcd498b2/static/app/components/forms/model.tsx#L194-L200) · [More projects using MobX →](https://dashboard.exa.ai/playground/search?q=React%20projects%20that%20use%20mobx&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import React from "react"
import ReactDOM from "react-dom"
import { makeAutoObservable } from "mobx"
import { observer } from "mobx-react-lite"

// Model the application state.
const myTimer = makeAutoObservable({
    secondsPassed: 0,
    increase() {
        this.secondsPassed += 1
    },
    reset() {
        this.secondsPassed = 0
    }
})

// Build a "user interface" that uses the observable state.
const TimerView = observer(({ timer }) => (
    <button onClick={() => timer.reset()}>Seconds passed: {timer.secondsPassed}</button>
))

ReactDOM.render(<TimerView timer={myTimer} />, document.body)

// Update the 'Seconds passed: X' text every second.
setInterval(() => {
    myTimer.increase()
}, 1000)

```

From [README.md](https://github.com/mobxjs/mobx/blob/main/README.md)

### Valtio

[GitHub](https://github.com/pmndrs/valtio) · [npm](https://www.npmjs.com/package/valtio) · [Docs](https://valtio.dev/)

Valtio wraps a plain object in a proxy with `proxy`, and code changes it by assigning to its fields from anywhere, such as a timer callback. In a component, `useSnapshot` returns a read-only snapshot and renders the component again only when a field it read has changed. Outside React, `subscribe` runs a callback on every change to the whole state or to one nested object.

- Downloads / mo: 12.2M
- Stars: 10.2K
- Last release: 2.3.2
- License: MIT
- Capabilities: [From the Valtio docs](https://valtio.dev/)

**Strengths**

- **Direct mutation.** Event handlers and plain functions change state by assigning to the proxy's fields.

**Watch out for**

- **Snapshots are frozen.** A method called on a snapshot can't change state. The README recommends arrow functions that change the proxy directly.

```sh
npm install valtio
```

**supabase/supabase** (115.1K stars)

[supabase/supabase](https://github.com/supabase/supabase) 

```typescript
export function createDatabaseSettingsState() {
  const state = proxy({
    usePoolerConnection: true,
    setUsePoolerConnection: (value: boolean) => {
      state.usePoolerConnection = value
    },
    showPoolingModeHelper: false,
    setShowPoolingModeHelper: (value: boolean) => {
      state.showPoolingModeHelper = value
    },
  })

  return state
}

```

[apps/studio/state/database-settings.tsx](https://github.com/supabase/supabase/blob/aac6e0aad7b134f4663fa7bba71c5105a7895132/apps/studio/state/database-settings.tsx#L5-L18) · [More projects using Valtio →](https://dashboard.exa.ai/playground/search?q=valtio%20GitHub%20projects)

**Quickstart**

```typescript
import { proxy, useSnapshot } from 'valtio'

const state = proxy({ count: 0, text: 'hello' })

// This will re-render on `state.count` change but not on `state.text` change
function Counter() {
  const snap = useSnapshot(state)
  return (
    <div>
      {snap.count}
      <button onClick={() => ++state.count}>+1</button>
    </div>
  )
}

```

From [README.md](https://github.com/pmndrs/valtio/blob/main/README.md)

## FAQ

### Which React state management library should I use?

For one shared store read through hooks, [Zustand](#zustand) needs no provider component. [Jotai](#jotai) keeps many small values as atoms that combine into derived ones, and [Redux Toolkit](#redux-toolkit) adds RTK Query for loading and caching server data. [MobX](#mobx) and [Valtio](#valtio) let code change state by plain assignment.

### Zustand vs Redux: which should I use?

Zustand stores state in a hook that any component calls without a provider, and the functions that update the state live in the same store. Redux Toolkit is the official way to write Redux logic: `createSlice` generates actions and reducers, and RTK Query handles server data. An app that already uses Redux keeps its store and moves to Redux Toolkit.

### Jotai vs Zustand: which should I use?

Zustand keeps state in one store, and each component selects the part it reads. Jotai keeps each value in its own atom, used like `useState`, and builds derived atoms from other atoms. Both libraries work without a provider component.

### React Context vs Redux: do I need a state library?

React Context passes a value through the component tree with no extra package. Zustand's README lists three differences from Context: less boilerplate, components that render only on changes, and centralized, action-based updates.

### What is TanStack Store?

TanStack Store is an immutable, reactive data store that sits at the core of the other TanStack libraries. Its React adapter reads state with `useSelector`, which renders a component again only when the selected value changes.

### MobX vs Redux: which should I use?

MobX tracks which observable values each component reads, so updates are plain assignments and only the affected components render again. Redux Toolkit routes every change through actions and reducers defined in slices, and its usage guide keeps state to serializable values.

## How this page was built

Data checked Nov 19, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "React state management libraries Zustand Jotai Redux Toolkit MobX code examples derived state persistence",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
