Losing .bind(this) in React

Getting rid of .bind(this) in React component.

Photo by JANNIK SELZ on Unsplash

If you used React in your time, you probably had to write some of .bind(this) code. And yes, I know:

  • it looks pretty ugly, plus,
  • it’s taking up some extra space in the codebase.

Luckily, there are some proposed features of JavaScript that can make .bind(this) the past for us.