Created
March 19, 2024 06:33
-
-
Save by-nari/ad4f6da5fe33d60b14a417753dd81602 to your computer and use it in GitHub Desktop.
Delaying React Lazy Loaded Component Import
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
const IndexPage = React.lazy(() => | |
new Promise<{ default: React.ComponentType }>(resolve => | |
setTimeout(() => { | |
resolve( | |
import('./pages/IndexPage').then(module => ({ default: module.IndexPage })) | |
); | |
}, 3000000) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment