Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function combineProviders(providers) {
return class Combined extends React.Component {
render() {
return (
providers.reverse().reduce((acc, Provider) => (
<Provider>{acc}</Provider>
), this.props.children)
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment