Skip to content

Instantly share code, notes, and snippets.

@PierreCavalet
Last active May 24, 2019 11:24
Show Gist options
  • Save PierreCavalet/3aa6dd2cb2cf5b83930505aa5a2fd80d to your computer and use it in GitHub Desktop.
Save PierreCavalet/3aa6dd2cb2cf5b83930505aa5a2fd80d to your computer and use it in GitHub Desktop.
Async Heavy
import React, { Suspense, lazy } from 'react'
const LazyHeavy = lazy(() => import('./Heavy'))
export default function AsyncHeavy() {
return (
<div>
<Suspense fallback={<div>Loading...</div>}>
<LazyHeavy />
</Suspense>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment