Skip navigation
❌ Avoid using useState for more complex state management
0:00 / 0:32

❌ Avoid using useState for more complex state management

George Moller

@_georgemoller118K followers

Visit on X
1,030 likesDownloadOriginal post

124,118 views

❌ Avoid using useState for more complex state management ✅ Instead use useReducer ↓

11 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 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 just like this one. Check them out ↓

    4 likes

  • statuscast's profile picture

    @statuscast

    Help your IT team cut through 'Are you down?' clutter with StatusCast’s Audience Specific Status Pages. Tailor your status page to each user's role and needs for effective incident communication.

    1,183 likes

  • Rahi Jamil's profile picture

    @rahijamil_

    Totally agree! useReducer simplifies state transitions and makes code more maintainable. 🎯 #ReactJS #useState #useReducer

    2 likes

  • Bart ⚡'s profile picture

    @bzagrodzki

    Honestly, I always think that when your state is too complex for useState then you did something wrong.

    2 likes

  • Chris Staudinger's profile picture

    @ChrisStaud

    I'm loving this new visual style George! 🤩 And on point React tips as always! 😀

    1 like

  • George Moller's profile picture

    @_georgemoller

    Always happy that you like the content Chris! Big fan of your content too 💪

  • Mithlesh's profile picture

    @mithleshjs

    That was life saver. Thanks 😊

    1 like

  • George Moller's profile picture

    @_georgemoller

    Glad you found value in this tweet Mithlesh!

  • Pavel Romanov's profile picture

    @pavl_ro

    It is exactly what I noticed today on a code review😄 Besides the mentioned benefits, we have cleaner components in general since all state-related logic moved out of the component

    1 like

  • George Moller's profile picture

    @_georgemoller

    Yes, useReducer has a better api than useState. Having said that, I still find use cases for useState.

    1 like