Skip to content

Instantly share code, notes, and snippets.

@weianofsteel
Created March 3, 2021 10:47
Show Gist options
  • Save weianofsteel/61b3ace43a008cb59182b6289b87d401 to your computer and use it in GitHub Desktop.
Save weianofsteel/61b3ace43a008cb59182b6289b87d401 to your computer and use it in GitHub Desktop.
React.lazt
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