Key patterns:
- Defer state reads (don't subscribe in callbacks)
- Use
React.memo and useMemo for expensive work
- Primitive dependencies in effects
- Derived booleans instead of raw values
- Functional
setState for stable callbacks
Impact: MEDIUM - Reduces wasted computation.
Don't subscribe to state only used in callbacks:
React.memo for Expensive Components
useMemo for Expensive Calculations
Use primitive dependencies instead of objects:
Use functional form for stable callbacks:
Lazy State Initialization
Pass function to useState for expensive initial values:
startTransition for Non-Urgent Updates
Zustand Store Optimization
Subscribe to minimal slices:
For more detailed technical guidance, see these reference files: