Skip to content

Instantly share code, notes, and snippets.

@Brunomm
Created August 10, 2018 19:51
Show Gist options
  • Save Brunomm/ba2e3e6fa4f427c8a367779b71dcdc18 to your computer and use it in GitHub Desktop.
Save Brunomm/ba2e3e6fa4f427c8a367779b71dcdc18 to your computer and use it in GitHub Desktop.
example component with props
const withSelectProps = (SelectComponent) => {
return function ConnectedComponent(props){
return(
<Provider selectProps={props}>
<Consumer>
{ ({selectProps, ...contextProps}) => <SelectComponent {...selectProps} contextProps={contextProps} /> }
</Consumer>
</Provider>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment