on-internet
← Community

React Router 404 changing page content but not url

Stack Overflow ·

I am building a project with my college group, and I am having some trouble with react-router-dom 404 route. It works when you write an unknown path, and redirects you to the <App /> page component. But the browser url does not change. Which is odd because when I searched for a solution, all that showed up was people asking about the url changing but not the page content. As it shows in the attached image, the page content is from a path described like this: <Route path="/home" element={<Homepage />} /> , with the element Homepage.tsx and the url path /home. But the non existing path is still

Comments

Sign in or sign up to comment and upvote.

No comments yet.