Skip to content

Instantly share code, notes, and snippets.

@austinroy
Created May 17, 2019 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austinroy/102c2a0245101f246e678bf680b0fb1c to your computer and use it in GitHub Desktop.
Save austinroy/102c2a0245101f246e678bf680b0fb1c to your computer and use it in GitHub Desktop.
Example of Suspense in React
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