Im doing ReactJS course in Codeacademny and they confused me.
(EDIT - full code) Photo of the code :
and there's no constructor or anywhere call to any bind method for the scream
class method.
However in further exercises they tell you can't do that.
I probably miss something.
The bind() is an inbuilt method in React that is used to pass the data as an argument to the function of a class based component.
To call a method from another class component in React. js, we can pass the class method as a prop to a child component. We have components Class1 and Class2 . And Class1 is a child of Class2 .
Apparently this.scream
is an arrow function. Arrow function does not require binding. It points to the right context by default.
scream = () => { ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With