3 ms·
if you're seeing walls of warnings about useEffect, or having trouble adding a modal to your app, then you probably ARE doing it poorly, no offense intended. I
by schwartzworld 7y ago
if you're seeing walls of warnings about useEffect, or having trouble adding a modal to your app, then you probably ARE doing it poorly, no offense intended.
It takes a while to really grok top-down data flow and how react components should be structured, but when you do it's magic.
As to useEffect, try not to use it. It's mainly for when you need to touch something completely outside the React tree.
- ge96 7y agoThat's interesting your point about useEffect. I mean I am using it because I'm using the functional way to build things vs. class. I'd prefer the class way honestly so I can just use the regular lifecycles eg. didMount/willMount/etc... I did figure out how to fix the issues eg. prop depedency, but it is kind of annoying when anything inside the useEffect triggers the warnings. Most recently I had a mobile app I had to make and it had a navbar/body/bottom navbar. I built the app split in three, so the navbar/bottom navbar took the routes to render what is shown, similar to the body... but this caused communication issues eg. you click on a thing in the bottom navbar, affects something in body and something renders/updates in the top navbar too. yeah my architecting can use work I don't deny that. Generally though it's the whole "action causes re-render" that I'm not 100% with but again probably goes back to architecture.