Created
July 8, 2017 06:19
-
-
Save mihir0x69/cf8a19f22f75fdbf215c4e8723051b1b to your computer and use it in GitHub Desktop.
Require.ensure
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
module.exports = { | |
getComponent(location, cb) { | |
require.ensure([], require => { | |
cb(null, require('./MyComponent.react.js').default) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment