diff --git a/examples/crm/src/Layout.tsx b/examples/crm/src/Layout.tsx index 99f68c1f70a..da32c47b145 100644 --- a/examples/crm/src/Layout.tsx +++ b/examples/crm/src/Layout.tsx @@ -1,9 +1,9 @@ -import React, { HtmlHTMLAttributes } from 'react'; +import React, { Suspense, HtmlHTMLAttributes } from 'react'; import { CssBaseline, Container } from '@mui/material'; import { CoreLayoutProps, CheckForApplicationUpdate } from 'react-admin'; import { ErrorBoundary } from 'react-error-boundary'; -import { Error } from 'react-admin'; +import { Error, Loading } from 'react-admin'; import Header from './Header'; const Layout = ({ children }: LayoutProps) => ( @@ -14,7 +14,7 @@ const Layout = ({ children }: LayoutProps) => (
{/* @ts-ignore */} - {children} + }>{children}
diff --git a/examples/crm/src/deals/DealList.tsx b/examples/crm/src/deals/DealList.tsx index 17ff80a4f48..c67aee1ce3b 100644 --- a/examples/crm/src/deals/DealList.tsx +++ b/examples/crm/src/deals/DealList.tsx @@ -17,7 +17,7 @@ import { DealShow } from './DealShow'; import { OnlyMineInput } from './OnlyMineInput'; import { typeChoices } from './types'; -export const DealList = () => { +const DealList = () => { const { identity } = useGetIdentity(); const location = useLocation(); const matchCreate = matchPath('/deals/create', location.pathname); @@ -61,3 +61,5 @@ const DealActions = () => { ); }; + +export default DealList; diff --git a/examples/crm/src/deals/index.ts b/examples/crm/src/deals/index.ts index 8b4143999fc..4a13f205c98 100644 --- a/examples/crm/src/deals/index.ts +++ b/examples/crm/src/deals/index.ts @@ -1,5 +1,6 @@ /* eslint-disable import/no-anonymous-default-export */ -import { DealList } from './DealList'; +import * as React from 'react'; +const DealList = React.lazy(() => import('./DealList')); export default { list: DealList,