I'm not talking about what is inside the useEffect in this particular case. I'm talking about the comment where you said empty dependency array will cause the effect to run in each render.
a useEffect runs each render when there is
no dependency array is provided, not when there is an empty dependency array.
eka waradi nm react docs th waradi wenna one
https://react.dev/reference/react/useEffect#my-effect-runs-after-every-re-render
PS: If you tried to say that useEffect runs after each render even if an empty array is provided because of the logic inside useEffect, no worries. I just wanted to correct that comment as in the way it was written, it was perceived as a generalized comment.