State Management
Patterns and tools for managing application state effectively
State Management
Overview
Effective state management is crucial for building maintainable and performant React Native applications. Our architecture follows a clear separation of concerns, with specialized tools for different types of state. The foundation of our state management approach is the Golden Rule: Server state belongs in TanStack Query, Client state belongs in Zustand, Component state belongs in React.
Key State Management Documentation
State Management Architecture
Learn our fundamental state management philosophy and the Golden Rule for separating different types of state.
Server State
Patterns for managing server data with TanStack Query, including caching, refetching, and mutations.
Client State
Global application state management with Zustand, including store design and persistence.
Component State
Techniques for managing local component state effectively with React's built-in state management.
Integration Patterns
How to integrate different state management approaches for optimal performance and developer experience.
State Management Principles
Our state management approach is guided by these core principles:
- Separation of Concerns - Different types of state have different requirements and should use specialized tools
- Data Locality - Keep state as close as possible to where it's used
- Minimal Re-renders - Design state to prevent unnecessary component re-renders
- Type Safety - Leverage TypeScript for fully typed state management
- Developer Experience - Prioritize simple APIs with minimal boilerplate