Created
October 21, 2018 08:17
-
-
Save sagar-gavhane/4cf7a6b825330a3d586d57aca976db8a to your computer and use it in GitHub Desktop.
This code snippet is written during publishing article on "Code Splitting in React". article link: https://dev.to/sagar/increase-user-interactions-by-implementing-code-splitting-in-react-5a1e
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
const modulePath = './someFile.js'; // path of module | |
// dynamic import() module | |
import(modulePath).then(module => { | |
return module.default; // return default function of es module | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment