Files
react.dev/examples/context/reference-caveats-solution.js
Niklas P 49fd7d5f11 Update reference-caveats-solution.js (#3609)
As referenced in https://reactjs.org/docs/context.html update the example to use the naming conventions used across the page.
2021-04-05 11:31:03 +02:00

19 lines
338 B
JavaScript

class App extends React.Component {
constructor(props) {
super(props);
// highlight-range{2}
this.state = {
value: {something: 'something'},
};
}
render() {
// highlight-range{2}
return (
<MyContext.Provider value={this.state.value}>
<Toolbar />
</MyContext.Provider>
);
}
}