Skip navigation
❌ Avoid listening for ref changes with useEffect() in React.
0:00 / 0:20

❌ Avoid listening for ref changes with useEffect() in React.

George Moller

@_georgemoller118K followers

Visit on X
959 likesDownloadOriginal post

101,654 views

❌ Avoid listening for ref changes with useEffect() in React. ✅ Instead use a ref callback function.

11 Comments

Comments from the original post on X (Twitter)

  • George Moller's profile picture

    @_georgemoller

    Hey there 👋 Friendly reminder that I have more than 100 infographics and video animations just like this one. Check them out ↓

    11 likes

  • George Moller's profile picture

    @_georgemoller

    Hey there 👋 Friendly reminder that I have more than 100 infographics and video animations just like this one. Check them out ↓

    1 like

  • Ritika kaur's profile picture

    @Ritika_kaurr

    Great job, George! It's always nice to discover new possibilities. Thanks!

    3 likes

  • George Moller's profile picture

    @_georgemoller

    Thanks Ritika, yes this is a pain point most react developers have, so I wanted so share some content around it.

    1 like

  • waqar ahmed's profile picture

    @waq_r

    👍 I have wasted hours with ref current.

    2 likes

  • George Moller's profile picture

    @_georgemoller

    We have all been there I think 😅

    2 likes

  • pavi2410's profile picture

    @PavitraGolchha

    This is great

    1 like

  • Amit's profile picture

    @Amit_T18

    Very useful tip for improving code and its performance!

    1 like

  • George Moller's profile picture

    @_georgemoller

    Glad you found vale in the tweet Amit!

    1 like

  • Shalini Tewari's profile picture

    @maybeshalinii

    Amazing tip for developers!

    1 like

  • George Moller's profile picture

    @_georgemoller

    Glad you found value in the video Shalini!