Skip to content

Commit 18571a5

Browse files
committed
lazy load index component
1 parent 759bbef commit 18571a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
1+
import React, { Suspense } from 'react';
22
import ReactDOM from 'react-dom';
3-
import App from './src/app.jsx';
3+
const App = React.lazy(() => import('./src/app.jsx'));
44

5-
ReactDOM.render(<App />, document.getElementById('root'));
5+
ReactDOM.render(<Suspense fallback={<p>Loading...</p>}><App /></Suspense>, document.getElementById('root'));

0 commit comments

Comments
 (0)