Skip to content

Instantly share code, notes, and snippets.

@theham3d
Created October 31, 2018 10:11
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 theham3d/8154c664a18bb79f85cfa958a77f7891 to your computer and use it in GitHub Desktop.
Save theham3d/8154c664a18bb79f85cfa958a77f7891 to your computer and use it in GitHub Desktop.
lazy example
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