Skip to content
masterclass Buddy

Zustand · Type Alias

PersistStorage

Zustand's persist middleware saves store state so it can return after reloads or restarts. It supports custom storage, selected fields, migrations, custom merging, and manual hydration.

Last updated

Syntax

persist<T, U = T>(stateCreatorFn: StateCreator<T, [], []>, persistOptions: PersistOptions<T, U>): StateCreator<T, [['zustand/persist', U]], []>

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • createJSONStorage
  • PersistStorage
  • rehydrate
  • onHydrate
  • onFinishHydration

Source: persist - Zustand Docs. Checked 2026-11-03.