J
J
johnwickdeveloper2021-03-02 11:52:41
React
johnwickdeveloper, 2021-03-02 11:52:41

Why is the route not being processed in React Router?

hello there
is a code

const routes = [
    {
      path: "/testusers",
      component: Users,
      routes: [
        {
          path: "/testusers/user",
          component: user
        },
      ]
    }
  ];

<Link to="/testusers/user">User</Link>
Now this code works and the component is rendered, but the task is to specify # in the route, and with it the required component is not loaded, while the URL changes.
This does not work
const routes = [
    {
      path: "/test#users",
      component: Users,
      routes: [
        {
          path: "/test#users/user",
          component: user
        },
      ]
    }
  ];

<Link to="/test#users/user">User</Link>
Please tell me how can I make Rout process #?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question