React Router blank page between two different projects #10869
-
I have built the first project and I can navigate among its pages without problems. So I built another project and hosted it on a sub directory and when I try to navigate between the first project and the second one, I get a blank page. I have to refresh the page to make it work. Is there a fix for this issue or do I have to attach the second project to the first one? I also tried to remove the custom wrapper but it didn't work anyway. I'm using react-router-dom 6.4.0. First project router:
Second project router:
Firts project package.json:
Second project package.json:
This is the way I try to navigate from the first one to the second one:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can't route between 2 separate apps via |
Beta Was this translation helpful? Give feedback.
You can't route between 2 separate apps via
navigate
, that is for navigating to routes within the current application. So you're getting a 404 blank page because the current app doesn't know about the/dashboard
routes. Instead, if you need to navigate to an external route and perform a full document reload, you should navigate usingwindow.location
.