Using parentheses or not... That's a topic that can seem quite complicated when we start with React! Let’s discover together when to add them and when to never add them.
Situations Where You Need to Use Parentheses
When we want to immediately execute the function:
myFunction();Or when we want to pass parameters:
<MyComponent myProp={() => myFunction('Elon')} />
Situations Where You Should Not Use Parentheses
When we just want to pass a reference to a function/method to a component, so that it can execute it later:
<MyComponent myProp={myFunction} />






