1class Display extends React.Component({
2 show(evt) {
3 // code
4 },
5 render() {
6 // Render the div with an onClick prop (value is a function)
7 return (
8 <div onClick={this.show}>Click Me!</div>
9 );
10 }
11});
1class Display extends React.Component({
2 show(evt) {
3 // code
4 },
5 render() {
6 // Render the div with an onClick prop (value is a function)
7 return (
8 <div onClick={this.show}>Click Me!</div>
9 );
10 }
11});