Skip to content

Instantly share code, notes, and snippets.

@ufukcanli ufukcanli/context.js
Last active Apr 26, 2019

Embed
What would you like to do?
Creating provider class
export class Provider extends Component {
state = {
name: 'Ufuk',
age: 22,
};
render() {
return (
<Context.Provider value={{
state: this.state
}}>
{this.props.children}
</Context.Provider>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.