react-router-dom#RouteObject TypeScript Examples
The following examples show how to use
react-router-dom#RouteObject.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdminRoutes.tsx From nodestatus with MIT License | 9 votes |
AdminRoutes: FC = () => {
const routes: RouteObject[] = [
{
path: '/dashboard',
element: <Dashboard />
},
{
path: '/management',
element: <Management />
},
{
path: '/incidents',
element: <Incidents />
},
{
path: '/',
element: <Navigate to="/dashboard" />
}
];
return useRoutes(routes);
}
Example #2
Source File: routes.tsx From one-platform with MIT License | 6 votes |
routes: RouteObject[] = [
{
path: '/',
element: <AppLayout />,
children: [
{
path: '/',
element: <HomePage />,
},
],
},
]
Example #3
Source File: GlobalRoutes.tsx From nodestatus with MIT License | 6 votes |
GlobalRoutes: FC = () => {
const routes: RouteObject[] = [
{
path: '/login',
element: <Login />
},
{
path: '/*',
element: <LayoutHandler />
}
];
return useRoutes(routes);
}
Example #4
Source File: routers.ts From npm-unpkg with MIT License | 6 votes |
routes: RouteObject[] = [
{
path: '/',
element: lazy(() => import('./pages/Home')),
},
{
path: '/pkg/:name',
element: lazy(() => import('./pages/Preview')),
},
{
path: '/pkg/:name/file/:filename/*',
element: lazy(() => import('./pages/Preview')),
},
{
path: '/pkg/:org/:name',
element: lazy(() => import('./pages/Preview')),
},
{
path: '/pkg/:org/:name/file/:filename/*',
element: lazy(() => import('./pages/Preview')),
},
]