const onClickButton = (color) => {
}
const onClickButton = (color) => () => {
}
Can anyone please tell the basic difference between these 2 functions..???
I was making a very simple page on which,on clicking a particular button,the color changes.
Now in this,I needed to create a function for onClick.
On using the 1st function ,my code did not worked ,but the 2nd function worked fine.
It will be great if anyone could solve this…
darshit khandelwal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.