-
-
Couldn't load subscription status.
- Fork 10.7k
Closed
Labels
Description
What version of React Router are you using?
6.4.0
Steps to Reproduce
live example : https://codesandbox.io/s/crazy-blackwell-v4ghn8?file=/src/App.js
code example:
const route = createBrowserRouter(
[
{
path: "/",
element: <Outlet />,
children: [
{
path: "/user",
element: <User />
},
{
path: "/test*",
element: <div>test *</div>
},
{
path: "*",
element: <div>Not found</div>
}
]
}
],
{
// basename: "/"
}
);
Expected Behavior
not found route can match when accessing path /
Actual Behavior
When accessing the root path /, Not Found component is not displayed on the page. It is only shown when I visit other unmatched routes (e.g. /notfound)