File tree 3 files changed +8
-5
lines changed
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
- import React , { HtmlHTMLAttributes } from 'react' ;
1
+ import React , { Suspense , HtmlHTMLAttributes } from 'react' ;
2
2
import { CssBaseline , Container } from '@mui/material' ;
3
3
import { CoreLayoutProps , CheckForApplicationUpdate } from 'react-admin' ;
4
4
import { ErrorBoundary } from 'react-error-boundary' ;
5
5
6
- import { Error } from 'react-admin' ;
6
+ import { Error , Loading } from 'react-admin' ;
7
7
import Header from './Header' ;
8
8
9
9
const Layout = ( { children } : LayoutProps ) => (
@@ -14,7 +14,7 @@ const Layout = ({ children }: LayoutProps) => (
14
14
< main id = "main-content" >
15
15
{ /* @ts -ignore */ }
16
16
< ErrorBoundary FallbackComponent = { Error } >
17
- { children }
17
+ < Suspense fallback = { < Loading /> } > { children } </ Suspense >
18
18
</ ErrorBoundary >
19
19
</ main >
20
20
</ Container >
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import { DealShow } from './DealShow';
17
17
import { OnlyMineInput } from './OnlyMineInput' ;
18
18
import { typeChoices } from './types' ;
19
19
20
- export const DealList = ( ) => {
20
+ const DealList = ( ) => {
21
21
const { identity } = useGetIdentity ( ) ;
22
22
const location = useLocation ( ) ;
23
23
const matchCreate = matchPath ( '/deals/create' , location . pathname ) ;
@@ -61,3 +61,5 @@ const DealActions = () => {
61
61
</ TopToolbar >
62
62
) ;
63
63
} ;
64
+
65
+ export default DealList ;
Original file line number Diff line number Diff line change 1
1
/* eslint-disable import/no-anonymous-default-export */
2
- import { DealList } from './DealList' ;
2
+ import * as React from 'react' ;
3
+ const DealList = React . lazy ( ( ) => import ( './DealList' ) ) ;
3
4
4
5
export default {
5
6
list : DealList ,
You can’t perform that action at this time.
0 commit comments