Patterns to minimize unnecessary re-renders.
Key patterns:
React.memo and useMemo for expensive worksetState for stable callbacksImpact: MEDIUM - Reduces wasted computation.
Don't subscribe to state only used in callbacks:
Use primitive dependencies instead of objects:
Use functional form for stable callbacks:
Pass function to useState for expensive initial values:
Subscribe to minimal slices:
For more detailed technical guidance, see these reference files: