Skip to content

Instantly share code, notes, and snippets.

@chentsulin
Last active November 6, 2018 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chentsulin/9c1a4d4b10944b7ed6ddd58eb6f35aee to your computer and use it in GitHub Desktop.
Save chentsulin/9c1a4d4b10944b7ed6ddd58eb6f35aee to your computer and use it in GitHub Desktop.
renderProps-Context
const App = () => {
return (
<ThemeContext.Consumer>
{theme => (
<LocaleContext.Consumer>
{locale => (
<div className={theme}>
{locale}
</div>
)}
</LocaleContext>
)}
</ThemeContext>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment