-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Web router expects factory functions in the component field, which means I cannot do
// ./routes.jsx
import AuthProvider from './components/AuthProvider'
const Dashboard = lazy(() => import('./pages/Dashboard'))
export const routes = [
{
path: '/',
component: Root,
children: [
{
path: '',
component: <AuthProvider><Dashboard /></AuthProvider>
},
{
path: 'login',
component: lazy(() => import('./pages/Login'))
},
{
path: 'not-found',
component: lazy(() => import('./pages/NotFound'))
},
{
path: '**',
redirectTo: 'not-found'
}
]
}
]I also cannot do
// ./pages/Dashboard.jsx
export default AuthProvider(Dashboard)How does one implement "protected routes" with web-router?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested