Created
March 3, 2021 10:47
-
-
Save weianofsteel/61b3ace43a008cb59182b6289b87d401 to your computer and use it in GitHub Desktop.
React.lazt
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 React, { Suspense } from 'react'; | |
const Sample = React.lazy(()=> import('./Sample') ); | |
Const Demo = () => { | |
return( | |
<React.Fragment> | |
<Suspense fallback={<div>Loading...</div>}> | |
<Sample /> | |
</Suspense> | |
</React.Fragment> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment