62
rated 0 times
[
66]
[
4]
/ answers: 1 / hits: 8044
/ 4 Years ago, thu, july 16, 2020, 12:00:00
What's the difference between this code:
<button onClick={()=>props.submitHandler(searchInputValue)}>Submit</button>
and
<button onClick={props.submitHandler(searchInputValue)}>Submit</button>
The difference is the first one has the parentheses and the second one doesn't. Without the parentheses, my app seems to be re-render indefinitely. Can someone kindly explain it to me?
More From » reactjs