Created
May 11, 2016 20:42
-
-
Save kristoferjoseph/81ae078d1f7e5a889dea96064144ae2e to your computer and use it in GitHub Desktop.
npm i defend-default --save
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
//Defends against es2015 default export | |
function defendAgainstDefault(component) { | |
if (component.default) { | |
component = component.default | |
} | |
return component | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment