Re:Learning Node.js and React while building a product
by miroslavpopovic on Tuesday June 13, 2017 @06:07PM
(#14549072)
Yes, class properties syntax. I mentioned that in the article.
Re:Learning Node.js and React while building a product
by coldtea on Tuesday June 13, 2017 @07:28PM
(#14549555)
Hmm, so why do you say "but they don't help with event handlers"? Because it's not yet standard?
Re:Learning Node.js and React while building a product
by miroslavpopovic on Wednesday June 14, 2017 @11:35AM
(#14553476)
Sorry, I didn't think about the arrow functions being used in class property syntax too. :) So yes, they do help with event handlers, I stand corrected.
They do. Just do:
and you don't need to bind in the constructor anymore. You'll need to use Babel of course to transpile that.