Created
July 17, 2019 16:34
-
-
Save jamesseanwright/65ce61e84707b19ac9144ef67b0405a0 to your computer and use it in GitHub Desktop.
React.lazy example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
const Lorem = React.lazy(() => import('./pages/Lorem')); | |
const App = () => ( | |
<React.Suspense fallback={<div className="loading-spinner" />}> | |
<Lorem /> | |
</React.Suspense> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment