3 ms·
It's not just having to understand what a class is, it's also having to know and remember to add a constructor to your class just to call `this.handleSomeEvent
by Vinnl 8y ago
It's not just having to understand what a class is, it's also having to know and remember to add a constructor to your class just to call `this.handleSomeEvent = this.handleSomeEvent.bind(this)`.
Sure, I know what it does and why it is needed, but it is ugly, cumbersome, and I keep forgetting it nonetheless.
- beaconstudios 8y agothere are babel solutions to this pain: - https://www.npmjs.com/package/babel-plugin-autobind-class-methods https://www.npmjs.com/package/babel-plugin-autobind-class-me... - https://www.npmjs.com/package/babel-plugin-transform-class-properties https://www.npmjs.com/package/babel-plugin-transform-class-p...