Created
April 4, 2018 14:04
-
-
Save hg-pyun/3cf7383bb6bcc4b31a99193fbc21c062 to your computer and use it in GitHub Desktop.
react v16.3.0 medium 03
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
function withTheme(Component) { | |
return function ThemedComponent(props) { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => <Component {...props} theme={theme} />} | |
</ThemeContext.Consumer> | |
); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment