If you don't want to think about binding, just use the arrow function syntax:
class Foo extends Component {
bar = () => {
// ...
}
} class Foo extends Component {
bar = () => {
// ...
}
}constructor(props) { super(props); this.func = this.func.bind(this); }
Is better if you care about performance.