What problem does it solve?
Managing side effects in React can lead to overuse of useEffect for tasks that could be handled more cleanly with render-time calculations, memoization, or event handlers. This skill helps you identify when an effect is truly needed and how to replace anti-patterns with simpler, safer patterns.
Core Features & Use Cases
- Quick Reference: a fast guide to do/don't patterns for common useEffect scenarios.
- Decision Tree: a visual workflow to decide whether to use an effect, memoize, or handle actions via events.
- Anti-Patterns & Better Alternatives: concrete examples of nine common mistakes and eight proven patterns to replace them, including data fetching with cleanup and derived state via render.
- Best Practices: guidance on starting without an effect, deriving state, correct cleanup, and when to use useSyncExternalStore for external data.
Quick Start
Refactor a component that uses useEffect to derive state during render and replace effects with memoization or event handlers.