Skip to content

Instantly share code, notes, and snippets.

@ufukcanli ufukcanli/Child.js
Created Apr 26, 2019

Embed
What would you like to do?
Updating Child component
export default class Child extends Component {
render() {
return (
<Context.Consumer>
{value => (
<div>
<h1>{value.state.name}</h1>
<p>{value.state.age}</p>
<button onClick={value.incrementAge}>Increment</button>
</div>
)}
</Context.Consumer>
);
}
}
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.