sfnext-state-management
Installation
SKILL.md
State Management Skill
This skill covers client-side state management in Storefront Next with server-first data loading.
Overview
Storefront Next keeps business data on the server (loader/action) and uses client state for UX continuity. In practice, app-wide state is commonly exposed through providers (for example auth/basket), while complex extension-specific state can use Zustand.
| State Type | Mechanism | Example |
|---|---|---|
| Server data | React Router loader |
Product details, category listings |
| App-wide client state | React context providers | Session display state, basket snapshot/hydration state |
| Feature client state | Zustand store | Store locator modal/search state |
| Mutations | React Router action (server) |
Add to cart, update profile |