managing-local-vs-global-state
Installation
SKILL.md
Local vs Global State
Decision Flow
Use Local State (useState) when:
- State only needed in one component
- State only needed by component + direct children
- State changes frequently (avoid Context re-renders)
- State is UI-specific (form input, toggle, etc.)
Use Lifted State when:
- Two sibling components need to share state
- Parent coordinates between children
- Still contained to component subtree