DEV Community

Discussion on: Understand call, apply, and bind functions in JavaScript like never before.

Collapse
 
arunran30008245 profile image
arun rana

Hey so whats that bind fn inside in react ' s class components's constructor ?

Collapse
 
swastikyadav profile image
Swastik Yadav

Hi Arun,

That binding of methods (event handlers) in React class component is exactly the bind method which is explained in this post.

You can use arrow functions in class component to avoid this binding, because arrow functions don't have their own "this" binding.