hosting a react router app in a file called admin.html #11241
Replies: 1 comment
-
For anyone else who sees this, I was able to make everything work. For my scenario, I also was using react bootstrap, which has its own link nav component for styling. I had to add the react router link inside of that to make it work. I haven't verified all scenarios yet but it seems fine for my simple use case. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi I am using createBrowserRouter with react-router-dom v 6.21.1
I am using vite and tailwind as well, though not sure that is relevant.
when I develop the application and host it in index.html, it works fine. when I change the name of the HTML file to admin.html, it completely throws the router.
I have several paths defined in the router, which is passed to a provider.
everything works fine until I change the filename from index.html to admin.html (I have a few different apps that get deployed to same directory) - then I get
No routes matched location "/admin.html"
when I click. I have several other links, not shown for brevity, which also begin to fail. How do I best let the router know to link/navigate relative to the page it exists in?Thanks
Beta Was this translation helpful? Give feedback.
All reactions