DEV Community

skptricks
skptricks

Posted on

Passing parameters to arrow function in react js

--

source : Passing parameters to arrow function in react js

This tutorial explains how to pass parameters to arrow function in react js application. Implementation of passing parameters to arrow function is bit different in react application. Lets see the below example that helps to build more understanding on arrow function.

Passing single parameter in arrow function :
oneParameter = a => e => {
alert(a);
};

Passing two parameters in arrow function :
twoParameter = (a, b) => e => {
alert(a + b);
};

Top comments (0)