component.prototype react code example
Example 1: react prototype function
class Foo extends Component {
handleClick() {
console.log('Clicado');
}
render() {
return ;
}
}
Example 2: react prototype function
class Foo extends Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
console.log('Clicado');
}
render() {
return ;
}
}