Hacker News new | ask | show | jobs
by Androider 3296 days ago
Nowadays you can just stick a class property anywhere in your React component:

   handleSomething = (params) => {
     ...
   };
and the use it in your render function like this without any binding:

  <Foo onSomething={this.handleSomething}/>
2 comments

Yes, class properties are the way to go.
Good suggestion - Thank you