4 ms·
Sounds like you are using it right but yeah you can setup the bindings or do an arrow function. I've been preferring just setting up the bindings in the constr
by exclusiv 9y ago
Sounds like you are using it right but yeah you can setup the bindings or do an arrow function.
I've been preferring just setting up the bindings in the constructor over arrow functions.
So for the author's example I'd just do: constructor (){ this.increment.bind(this); }
Then the template can stay cleaner with just onClick={this.increment}