5 ms·
The proposal README is written for TC39 and not React users, so it doesn't address the problems React users face. Yes, with public fields you can write ha
by danabramov 9y ago
The proposal README is written for TC39 and not React users, so it doesn't address the problems React users face.
Yes, with public fields you can write
handleClick = () => {
// ...
}
and it works like if you bound it in the constructor.
Hope this helps.
- dmitriid 9y agoIt’s not just React-specific. I was correct: the proposal does exactly nothing to make sure class methods are bound to class instances. handleClick = () => {...} This is a shitty workaround that abuses class fields and arrow functions