You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
369 B
15 lines
369 B
class Example extends React.Component {
|
|
render() {
|
|
// The inline function will be called when the context value changes,
|
|
// And when the props value changes!
|
|
return (
|
|
<Ctx.Consumer>
|
|
{value => (
|
|
<div>
|
|
Context value:{value}. Props value:{this.props.counter}
|
|
</div>
|
|
)}
|
|
</Ctx.Consumer>
|
|
);
|
|
}
|
|
}
|
|
|