The onclick event on the button does not work for the first click, and it works well from the second. Why is this?

   let button=document.getElementById('button');'lightcoral'?'lightgreen':'lightcoral'; this.setState({bank:bankTwo}):

Is this a javascript challenge?

yes. It is. It’s a react question.

The style does not change for the first click as well. Everything works fines from the second, both the state and the style.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.