I spent an hour debugging this react error

Publié le: 06 juillet 2020
sur la chaîne: Web Dev Cody
16,273
246

I got a bug in react where a sub component was trying to call a state setter passed in from props of the parent component. The issue took my about an hour to debug bug, but if I spent some time re-reading my code, I could have fixed it in 5 minutes. Programming sucks.

Warning: Cannot update a component (`App`) while rendering a different component (`Lobby`). To locate the bad setState() call inside `Lobby`, follow the stack trace as described in https://fb.me/setstate-in-render
in Lobby (at App.js:37)
in div (at App.js:35)
in App (at src/index.js:9)
in StrictMode (at src/index.js:8)

------------

For those who don't know, I'm a full stack web developer who has been in the industry for over 5 years now. There is a lot of things I have learned along the way and I'd like to share that knowledge with anyone wanting to learn!

like this video if you found it useful and would like to see more videos of the same content.

subscribe to my channel if you are trying to improve your abilities as a web developer, software engineer, or even if you are just learning to code.

Don't forget to turn on those bell notifications!

Book mark these links!
Twitter   / codylseibert  
GitHub https://github.com/codyseibert/youtube

I give credit to:
Toptal Subtle Patterns - for the thumbnail background patterns


Sur cette page du site, vous pouvez voir la vidéo en ligne I spent an hour debugging this react error durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Web Dev Cody 06 juillet 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 16,273 fois et il a aimé 246 téléspectateurs. Bon visionnage!