Devlog 5 - React Mumbo Jumbo
React is a liar
So it turns out that by default react puts the debug component in your main.jsx file. This is really cool, until you actually deploy your site (for me, I do this using github actions to vercel!)
The reason for this is that one of the things that strict mode does is mount, unmount, and instantly remount your component so that any race conditions that aren’t properly handled appear to not be a problem. Since I use the useEffect hook to update my dashboard component asynchronously, this was a problem.
Tricking liars
To solve this, I made a new isMounted boolean. This boolean handles the control flow of the useEffect hook, which mitigates this issue!
Attached below is an image of the new useEffect hook!
Additonally, this project is now officially shipable, due to it being deployed on vercel!
I may add tailwind css for better styling, but for now this is the first actual version of the project!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.