3 ms·
Interesting that they use the this.handleChange = this.handleChange.bind(this) example over the simpler lexical declaration. handleChange = () => {} Is
by brink 9y ago
Interesting that they use the
this.handleChange = this.handleChange.bind(this)
example over the simpler lexical declaration.
handleChange = () => {}
Is the reason for them not using the latter due to the spec not being finalized yet?
- deleted 9y ago[deleted]
- WorldMaker 9y agoThe spec is final (arrow functions were in ES2015), could be they just still have IE11 users they expect to support.
- danabramov 9y agoNo, these are "class fields" rather than arrow functions, and are not part of ES2015. This is why we're not using them in the docs yet. Indeed they would make everything a bit nicer :-)
- WorldMaker 9y agoAh, okay, that's what I missed from the example out of context.