React router dom is not redirecting to the route even though the url is changed
Hey I am facing a error. when I try to log in with my admin account on a website I am working in. The url changes but it doesn't redirect me to the admin dashboard. If I reload the website then I will be redirected to the admin dashboard and the issue won't come in if I don't reload after logging out.
Why am I getting this error and how to fix it ?
7 Replies
I guess some problem with how you've written your router or outlet. Maybe something isn't nested correctly. But you will need to share actual code for anyone to suggest a fix.
No I am checking the type of user and then navigating to their dashboard with useNavigate hook
Which codes should I post? I mean of which component ?
Can't use useHistory
Yeah, I was in the wrong documentation, sorry. <:sad_google:400614345672884234>
This issue only comes when in the beggining or if I refresh page when I logged out. Otherwise it works fine.