Created
October 31, 2018 10:11
-
-
Save theham3d/8154c664a18bb79f85cfa958a77f7891 to your computer and use it in GitHub Desktop.
lazy example
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
import React , { lazy , Suspense } from 'react'; | |
const ShomalComponent = lazy(() => import('./ShomalComponent')); | |
const MyComponent = props => ( | |
<Suspense fallback={<div>Loading...</div>}> | |
<ShomalComponent /> | |
</Suspense> | |
); | |
export default MyComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment