Calling event handler instead of passing reference – onClick={this.handleClick()} instead of onClick={this.handleClick}
Proper Event Handler Passing in React A common mistake in React is accidentally calling an event handler immediately instead of passing a reference to it. This causes the function to….