Skip to content
public-library›Rules›Zustand›Rehydrate persisted stores after React hydration

Rehydrate persisted stores after React hydration

In server-rendered apps, create persisted stores with skipHydration: true, and call store.persist.rehydrate() in an Effect after the app mounts. Render the default state until then, so the first client render matches the server.

In the full rule