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

Use Context when:

  • Many components at different nesting levels need state
  • Prop drilling through 3+ levels
  • Global configuration (theme, locale, auth)
Related skills
Installs
4
First Seen
Feb 4, 2026