Fix: Code splitting for auth routes

This commit is contained in:
Gustav Hansen 2023-08-15 21:02:56 +02:00
parent 54960e085c
commit 7bbfd55eaa
2 changed files with 5 additions and 7 deletions

View File

@ -214,8 +214,8 @@ export function App() {
<SkipToContent>{formatMessage({ id: 'skipToContent' })}</SkipToContent>
<TrackingProvider value={trackingContext}>
<Switch>
{authRoutes.map(({ path, Component }) => (
<Route key={path} path={path} component={Component} exact />
{authRoutes.map(({ path, component }) => (
<Route key={path} path={path} component={component} exact />
))}
<Route

View File

@ -2,11 +2,9 @@ import * as React from 'react';
export const AUTH_ROUTES_EE = [
{
Component() {
return React.lazy(() =>
import('../AuthResponse').then((module) => ({ default: module.AuthResponse }))
);
},
component: React.lazy(() =>
import('../AuthResponse').then((module) => ({ default: module.AuthResponse }))
),
path: '/auth/login/:authResponse',
},
];