Back to feed
Dev.to
Dev.to
7/15/2026
The original title is "Why I Rarely Use useEffect Anymore (and what I use instead) ep1"

The original title is "Why I Rarely Use useEffect Anymore (and what I use instead) ep1"

Original: Why I Rarely Use useEffect Anymore (and what I use instead) ep1

Short summary

A practical guide explaining when to avoid useEffect in React, covering common anti-patterns like deriving state, syncing props, and filtering data inside effects. The author recommends direct computation, useMemo for expensive operations, and data-fetching libraries like TanStack Query or SWR. Legitimate useEffect use cases remain for external system synchronization such as WebSockets, timers, and browser APIs.

  • Avoid useEffect for state derivation, prop syncing, and filtering — use direct computation or useMemo instead
  • Use TanStack Query or SWR for data fetching instead of manual useEffect fetch calls
  • Legitimate useEffect use cases: WebSockets, timers, browser APIs, and third-party library integration

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more