router icon indicating copy to clipboard operation
router copied to clipboard

Ranked Routes does not rank in Firefox in the same manner as other browsers => Chrome, Safari, Edge

Open fetters5 opened this issue 2 years ago • 1 comments

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:

  1. Go to https://codesandbox.io/s/flamboyant-haze-6l1hin?file=/src/index.tsx
  2. 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 image

Chrome image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Version: 3.3 and 3.6.1

fetters5 avatar Mar 01 '22 16:03 fetters5

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 /> }
      ]}
    >

obouchari avatar Jun 13 '22 14:06 obouchari

We'll be sure to trim slashes in the ranker from here forward.

tannerlinsley avatar Nov 10 '22 14:11 tannerlinsley