Zustand + React Context: Scoped Component Stores
Solving singleton store conflicts in repeated components using Dominik Dorfmeister's pattern
Zustand works as a global singleton by default, which creates problems when initializing from props, reusing components like tables on the same page, or resetting state in tests. By wrapping a vanilla Zustand store inside React Context, each component gets an isolated store instance with automatic cleanup on unmount while keeping Zustand's selectors and performance.