how to add prototype function in react code example
Example 1: react prototype function
class Foo extends Component {
handleClick() {
console.log('Clicado');
}
render() {
return <button onClick={this.handleClick.bind(this)}>Clique em mim!</button>;
}
}
Example 2: react prototype function
<button onClick={this.handleClick}>