|
|
|
|
|
by boubiyeah
3360 days ago
|
|
ES6 classes are a complete mess brought by corporate people loving OO, even in a setting that doesn't make sense. You can "autobind" with this notation: myMethod = () => { } but it doesn't look as good as myMethod() {} and you have to remember this EVERY TIME you add a method. Also, you never need to use the constructor in React.
Just do: state = {} in the body of the class.
You may need babel presets #918718$$&ééàdi for it to work though. |
|