Zustand in Next.js
Zustand stores created outside components are singletons — fine on the client, but problematic on the server where requests share the same module instance. Use the factory pattern to create a new store per request.
Zustand stores created outside components are singletons — fine on the client, but problematic on the server where requests share the same module instance. Use the factory pattern to create a new store per request.