router
router copied to clipboard
Ranked Routes does not rank in Firefox in the same manner as other browsers => Chrome, Safari, Edge
Describe the bug Ranked Routes does not rank in the same manner as other browsers such as Chrome, Safari, Edge. It will not find a page in the route list where as the other browsers will
To Reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/flamboyant-haze-6l1hin?file=/src/index.tsx
- If you click on the Auth link in FF it will go to the catch all route if you click on the link in Chrome it goes to the auth route
Expected behavior I would expect FF to sort the routes the same way that the other browsers do
Screenshots
Firefox 97.0.1
Chrome
Desktop (please complete the following information):
- OS: Windows
- Browser: Firefox
- Version: 3.3 and 3.6.1
Try removing the forward-slash from the "auth" path, change this from "/auth" to "auth":
<Router
location={location}
filterRoutes={rankRoutes}
routes={[
{
path: "",
element: <Wrapper />,
children: [
{ path: "/", element: <Index /> },
{ path: "posts", element: <PostsIndex /> },
{ path: "*", element: <NotFound /> }
]
},
{ path: "auth", element: <Auth /> }
]}
>
We'll be sure to trim slashes in the ranker from here forward.