Skip to content

Instantly share code, notes, and snippets.

@sagar-gavhane
Created October 21, 2018 08:17
Show Gist options
  • Save sagar-gavhane/4cf7a6b825330a3d586d57aca976db8a to your computer and use it in GitHub Desktop.
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
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