DEV Community

Discussion on: You don't know useEffect

Collapse
 
haosik profile image
Nikolay Mochanov

If I understood your question right - no, ref (isMounted in this case) should not be a part of dependencies because it is something different (from the 'state' for example) by nature. That said, changing useRef.current value does not cause the re-render, so it's just being changed 'silently' and only help the useEffects to fire when they really should.