logo /logo search Search menu 1 sign up or log in log in .user-info /menu 1 menu 2 node package manager Toggle Navigation npm Enterprise features pricing documentation support /menu 2 Orgs are free. Discover, share, and reuse code in your team. Create a free org » babel-plugin-autobind-class-methods Autobinds "this" to class methods and works with hot reloading. Compatible with the latest React Hot Loader 3-beta npm install babel-plugin-autobind-class-methods --save-dev Example .babelrc: { "presets": ["es2015", "react"], "plugins": ["autobind-class-methods"] } Example code: class Example { constructor(){ this.greeting = 'Hello' } greet(){ console.log(this.greeting) } render(){ setTimeout(this.greet, 0) } } const example = new Example() example.render() // logs out 'Hello', in vanilla js it would log out ...