Arrow Functions

Can someone explain to me the purposes of arrow functions . I kind of understand it as replacing this.props ? I dont understand yet why and when I am supposed to use arrow functions.
Additionally how do I know if im using an empty set of parenthesis or a variable ex - () => … or message => …

This is a pretty good overview on arrow functions syntax:

Hope it helps you.

Basically is to type less and have more clean code. Arrow functions can do the same as a normal function, but the code becomes more readable and less verbose.

Additionally you can use arrow function pretty much everywhere instead of class or basic function. You will just have to use hooks instead of the classic React lifecycle.

  • Arrow functions are not hoisted
  • They bind this to a particular value no matter what
  • Cleaner and shorter syntax.