正在加载视频...

视频加载失败

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

124,069 次观看 • 2 年前 •via X (Twitter)

11 条评论

George Moller 的头像
George Moller2 年前

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 ↓

George Moller 的头像
George Moller2 年前

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 ↓

statuscast 的头像
statuscast2 年前

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.

Rahi Jamil 的头像
Rahi Jamil2 年前

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

Bart ⚡ 的头像
Bart ⚡2 年前

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

Chris Staudinger 的头像
Chris Staudinger2 年前

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

George Moller 的头像
George Moller2 年前

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

Mithlesh 的头像
Mithlesh2 年前

That was life saver. Thanks 😊

George Moller 的头像
George Moller2 年前

Glad you found value in this tweet Mithlesh!

Pavel Romanov 的头像
Pavel Romanov2 年前

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

George Moller 的头像
George Moller2 年前

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

相关视频