useEffect changed in React 18 // useEffect called twice for an empty array

Опубликовано: 22 Июнь 2022
на канале: basarat
9,590
347

There is one key change to strict mode with react 18 and that has to do with mounting your component twice. That’s exactly what we will cover in this tutorial 🌹

Final Code on Github: https://github.com/basarat/demo-use-e...
Strict Mode docs: https://reactjs.org/docs/strict-mode....

#basarat #React #React18 #5MinutesOrLess #Tutorial #JavaScript #TypeScript

👇 ❤️ Subscribe for MOORE ❤️ 👇
https://www.youtube.com/basaratali?su...

*Feel Free To Read This Lot*

I'm Basarat, and I love helping developers. More about me:

Microsoft MVP for TypeScript
200K contributions on Stackoverflow. Top Contributor for TypeScript.
Udemy Courses: https://www.udemy.com/user/basaratali...
Creator https://designtsx.com
Book Author: Beginning NodeJS
Book Author: TypeScript Deep Dive
Egghead Instructor: https://egghead.io/q/resources-by-bas...
Creator of multiple hot ✨ed Github Open Source projects

Follow me on Twitter:   / basarat  
Follow me on GitHub: https://github.com/basarat
Donate: https://www.paypal.me/basaratali
Content Creation Kit (Camera / Lens etc.): https://kit.co/basarat/content-creation
Join to support the channel:    / basaratali  

Website: https://basarat.com/