Skip to content
DevMeme
6301 of 7590
Frontend Post #6907 · source on Telegram

The Universal Reaction to Explaining React's useEffect Hook

Description

A screenshot of a tweet from Jared Palmer, a well-known personality in the web development community. The tweet's text reads, '"Explain to me how useEffect works"'. Below this text is a reaction image of political commentator Tucker Carlson looking utterly perplexed and bewildered, with a furrowed brow and open mouth, as if struggling to comprehend a difficult concept. The logo for 'The Tucker Carlson Show' is visible in the bottom right corner. The humor stems from using a non-tech public figure's confused expression to perfectly encapsulate the frustration and mental gymnastics even experienced developers go through when dealing with the complexities of React's `useEffect` hook. It's a notoriously tricky feature to master due to its dependency array, cleanup functions, and execution timing within the component lifecycle

Comments

14
Anonymous ★ Top Pick My therapist told me to be more mindful of my dependencies. So I showed her my team's useEffect usage, and now we have sessions twice a week to deal with the infinite loops
  1. Anonymous ★ Top Pick

    My therapist told me to be more mindful of my dependencies. So I showed her my team's useEffect usage, and now we have sessions twice a week to deal with the infinite loops

  2. Anonymous

    If you can explain why useEffect fires twice in StrictMode without opening the docs, congratulations - you just earned the unofficial PhD in React metaphysics

  3. Anonymous

    After 5 years of explaining useEffect, we've collectively decided it's easier to just rewrite everything in server components and pretend the dependency array never hurt us

  4. Anonymous

    useEffect is like that senior architect who insists on reviewing every dependency change: you think you understand the rules until you forget one item in the array and suddenly your entire application is stuck in an infinite render loop, burning through API rate limits faster than a junior dev can say 'but it works on my machine.' The real kicker? Even after 5 years of React, you'll still occasionally stare at the linter warning about exhaustive-deps and wonder if the computer is gaslighting you about what should actually be in that dependency array

  5. Anonymous

    useEffect: mounts once, runs twice in dev, infinitely if your deps recreate functions - React's way of keeping seniors humble

  6. Anonymous

    useEffect is basically an at-least-once delivery queue keyed by referential equality; skip idempotency and StrictMode will replay it until your rate limiter quits

  7. Anonymous

    Explaining useEffect: it’s where side effects pretend to be idempotent until StrictMode runs them twice and your “[] vs [fn]” debate turns into a self‑inflicted DDoS of API calls

  8. @ZgGPuo8dZef58K6hxxGVj3Z2 1y

    Not the Node/Electron bullshit💀😭

    1. @itsTyrion 1y

      nah that's reactjs specifically

      1. @ZgGPuo8dZef58K6hxxGVj3Z2 1y

        Ah thx

      2. @erizpl 1y

        not react only, it's just state management pattern

        1. @itsTyrion 1y

          o? well ive only ever seen it with react

  9. アレックス 1y

    OK, so I'm not the Tucker Carlson Expert on React—listen, Facebook is WEEKS AWAY from a new JS framework...

  10. @pooyabehravesh 1y

    UseEffect? Well this is something that never works the way you want

Use J and K for navigation