Created
May 17, 2019 08:26
-
-
Save austinroy/102c2a0245101f246e678bf680b0fb1c to your computer and use it in GitHub Desktop.
Example of Suspense in React
This file contains 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
const DataComponent = React.lazy(() => import('./DataComponent')); | |
function MySuspenseComponent(){ | |
return ( | |
<Suspense fallback={<Spinner />}> | |
<DataComponnent/> | |
<Suspense> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment