5 UseState Mistakes That Keep You A Junior Developer Forever 😫 (React.js)

Coding in Flow Guide 1 years ago

Description

5 useState mistakes that even experienced React developers make.

Starting code: https://github.com/codinginflow/usestate-mistakes
Final code: https://github.com/codinginflow/usestate-mistakes/tree/solutions

⭐ Get my full-stack Next.js with Express & TypeScript course: https://codinginflow.com/nextjs
✅ Get my free React Best Practices course: https://www.codinginflow.com/reactbestpractices
💌 Join my newsletter for regular web dev tips: https://codinginflow.com/newsletter
💬 Join our developer community on Discord: https://codinginflow.com/discord

📣 Follow Coding in Flow on social media:
Twitter: https://twitter.com/codinginflow
Instagram: https://instagram.com/codinginflow
TikTok: https://tiktok.com/@codinginflow
Facebook: https://facebook.com/codinginflow

Timestamps:
0:00 - Introduction & sample code
0:54 - Mistake 1: Calling the initializer function
3:31 - Mistake 2: Resetting component state incorrectly
8:02 - Mistake 3: When and when not to use the updater function
12:41 - Mistake 4: Not deriving state
15:45 - Mistake 5: Managing form state incorrectly