In the Random Color Picker project, the Button has 2 attributes, but one of them doesn’t require parentheses. I would like to know why, what is the difference between those two?
I also included a picture.
1 Like
The difference is that you call the isLight function immediately when rendering the button. handleClick is just called on click on the button and therefore it is sufficient to just pass the reference to the function handleClick.
1 Like