I am trying to refactor the following code from my render view:
That usually happens when you call
onClick={this.handleButton()} - notice the () instead of:
onClick={this.handleButton
}
onClick={this.handleButton} - notice here we are not calling the function when we initialize it