Component renders → effect runs → setState triggers another render.
If you find yourself using useEffect just to keep some state in sync with other state or props, pause. You probably don’t need that state at all. Derive it directly instead.
#ReactJS #NextJS #ReactHooks #WebDev
Component renders → effect runs → setState triggers another render.
If you find yourself using useEffect just to keep some state in sync with other state or props, pause. You probably don’t need that state at all. Derive it directly instead.
#ReactJS #NextJS #ReactHooks #WebDev