MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / Switcher

Class Switcher

code/event-handlers/src/app.jsx:23–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21};
22
23class Switcher extends React.Component {
24 constructor(props) {
25 super(props);
26 this.state = { name: 'React in patterns' };
27 this._buttonClick = this._handleButtonClick.bind(this);
28 }
29 render() {
30 return (
31 <button onClick={ this._buttonClick }>
32 click me
33 </button>
34 );
35 }
36 _handleButtonClick() {
37 console.log(`Button is clicked inside ${ this.state.name }`);
38 }
39};
40
41ReactDOM.render(<div><Switcher /><Form /></div>, document.querySelector('#container'));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected