Languages

React - react-router-dom doesn't work (blank page)

3 points
Asked by:
lena
714

When I try to use basic routing with react-router-dom inside one component, every other component on the page disappears and I don't know why.

My code:

2 answers
3 points
Answered by:
Admin Dirask Community
4380

There were some major changes in new version of react-router-dom (v6). Check your version and update the code.

Your code with react-router-dom v6 should look like this:

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join