zustand-best-practices

Installation
SKILL.md

Zustand best practices

Use when using Zustand for client-side global or shared state.

Store shape

  • Keep stores small and focused by domain or feature.
  • Split large global state into multiple stores instead of one giant store.

Updates and API

  • Prefer actions inside the store for state updates (clear entry points).
  • Keep business rules in store actions, not scattered across components.

Selectors and renders

  • Use selectors to avoid unnecessary re-renders.
  • Use shallow comparison when selecting multiple fields as an object.
Installs
1
First Seen
Apr 12, 2026
zustand-best-practices — alexandretrotel/skills