ReactJS Button onclick function called on render

You are happily coding your ReactJS application. You bind your function to a onclick or onchange to do your processing. Suddenly, you see this long error in your console. The error is cryptic and normally you will get a depth error or change function called in render. If you see there that means that you made a coding error.

First, you called a function in onClick with a parenthesis – function() rather than just function.

Second, if you mean to pass a parameter to your handle function, you will been to bind with argument.

handleFunction.bind(this, argument)