I\'m a beginner in React, and I\'m a little confused about calling a function in React.
I saw the following ways and I don\'t know when to use each and which one.
<
In ES6 you can use normal function or Arrow Function:
Function1 (Normal Function)
functionA(){
//Something here
}
Then should call this.functionA()
Function2 (ArrowFunction)
functionA = () => {
//SomeThing Here
}
Then should call this.functionA
*Function3 (Eg: in a const of React) *
const A = (functionTest) =>{
return (
{functionTest}
);
}
functionTest is mapStateToProps in React :)
I hope it is helpful for you :)