June 23, 2020

What would be the common mistake of function being called every time the component renders?

You need to make sure that function is not being called while passing the function as a parameter.

Instead, pass the function itself without parenthesis: