Skip navigation
❌ Don't pass props to multiple nested components in React.
0:00 / 0:34

❌ Don't pass props to multiple nested components in React.

George Moller

@_georgemoller118K followers

Visit on X
840 likesDownloadOriginal post

137,487 views

❌ Don't pass props to multiple nested components in React. ✅ Instead use libraries like react-query to better handle server state.

10 Comments

Comments from the original post on X (Twitter)

  • George Moller's profile picture

    @_georgemoller

    I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and video animations just like this one. Check them out ↓

    19 likes

  • George Moller's profile picture

    @_georgemoller

    I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and video animations just like this one. Check them out ↓

    7 likes

  • Dominik 🔮's profile picture

    @TkDodo

    It would be cool if you could recommend importing from '@tanstack/react-query' instead of just 'react-query'. We've moved to the TanStack umbrella over a year ago.

    30 likes

  • George Moller's profile picture

    @_georgemoller

    Will do Dominik!

    2 likes

  • Akhil 17's profile picture

    @ak_h_il_17

    But using the same query inside dashboard will trigger another api call right?

    4 likes

  • George Moller's profile picture

    @_georgemoller

    Nope, it only triggers another api call if the data is not already in the cache.

    6 likes

  • Pavel Romanov's profile picture

    @pavl_ro

    Love this concept and react-query in general! First time I saw it was in this great article:

    2 likes

  • MUIZ's profile picture

    @PrinceAdeyeyeMO

    I use Redux for state management. React query look simpler and reduces redux broiler plate. Does react query works with React Native? Any cons I should be aware of?

    2 likes

  • Oury Tenguella's profile picture

    @ourystd

    State colocation, right ?

    1 like

  • Nikki Siapno's profile picture

    @NikkiSiapno

    Agree, important tip George!

    1 like