r3f-state-management

Installation
SKILL.md

R3F State Management

When to Use

Use this skill when:

  • Managing global game state in R3F
  • Sharing state between 3D and UI components
  • Implementing player state, inventory, score
  • Coordinating multiple 3D objects
  • Optimizing state updates for performance

Core Principles

  1. Zustand for Global State: Fast, minimal re-renders
  2. React Context for Scoped State: Component trees
  3. Local State for Component-Only: useState
  4. Immutable Updates: Never mutate state directly
  5. Selectors for Performance: Subscribe to slices
  6. Avoid Props Drilling: Use stores or context
Installs
7
GitHub Stars
26
First Seen
Jul 10, 2026