Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
lazy loading
import React, {lazy, Suspense} from 'react';
const OtherComponent = lazy(() => import('./OtherComponent'));
const MyComponent = () => (
<Suspense fallback={<div>Loading...</div>}>
<OtherComponent />
</Suspense>
)
export default MyComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.