It's been sometime I used react,
If my memory is correct, ur useRef variable isMounted should also be automatically part of dependencies array doesn't it?
If u don't add it, IDE doesn't complain?
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's been sometime I used react,
If my memory is correct, ur useRef variable isMounted should also be automatically part of dependencies array doesn't it?
If u don't add it, IDE doesn't complain?
Maybe someone could u get this to my head.
If I understood your question right - no,
ref(isMountedin this case) should not be a part of dependencies because it is something different (from the 'state' for example) by nature. That said, changinguseRef.currentvalue does not cause the re-render, so it's just being changed 'silently' and only help theuseEffects to fire when they really should.