react-useeffect-audit
Installation
SKILL.md
React useEffect Audit
Effects are an escape hatch for synchronizing with external systems (DOM, network, third-party widgets). If no external system is involved, you likely don't need an Effect.
Quick Decision Guide
| Scenario | Use Effect? | Alternative |
|---|---|---|
| Transform data for rendering | No | Calculate during render |
| Handle user events | No | Event handler |
| Cache expensive calculations | No | useMemo |
| Reset state when props change | No | key prop |
| Adjust state based on props | No | Calculate during render |
| Chain of state updates | No | Single event handler |
| Notify parent of state change | No | Call parent in event handler |
| Initialize app (once) | No | Module-level code |
| Subscribe to external store | No | useSyncExternalStore |
| Fetch data on mount/change | Yes | With cleanup; prefer framework |