React Router v6 Modal in a separate route

Viewed 1155

I have a react app, with react-router-dom v6 beta. Something like this:

function App() {
  let element = useRoutes([
    { path: '/', element: <Home /> },
    {
      path: 'users',
      element: <Users />,
      children: [
        { path: '/', element: <UsersIndex /> },
        { path: ':id', element: <UserProfile /> },
        { path: 'me', element: <OwnUserProfile /> },
      ]
    }
  ]);

  return element;
}

I am using outlet to render the pages when routing. I am trying to create modals with separate routes. Any help is appreciated.

1 Answers
Related