Using <Navigate /> causes "Maximum update depth exceeded"
Hey! I came across a weird bug that I'm not sure how to fix.
Basically, I have some logic like auth etc. that redirects logged out users back to the login page. I noticed that if I'm using the
but if I use
I can't figure out the exact reason it's happening though...
Code examples below...
My versions are the following:
Thanks!
Basically, I have some logic like auth etc. that redirects logged out users back to the login page. I noticed that if I'm using the
<Navigate /> component to redirect them, it causes a "Maximum update depth exceeded", or more specifically, this error:but if I use
useEffect and navigate = useNavigate(), then I don't get this error.I can't figure out the exact reason it's happening though...
Code examples below...
My versions are the following:
Thanks!