Reactjs - I Am Trying To Handle And Event In A Popup, But The Popup Is Not Being Rendered As It Should After An Event Execution
I have a function that is called when the user clicks a button on a popup of a reactjs applicatiomn. sendAnswer = () => { event.preventDefault(); console.log(this.
Solution 1:
this.setState({sentAnswer: true})
This is the state you are updating but your condition is base on !this.state.sent
.
Either change the condition to !this.state.sentAnswer
or this.setState({sent: true})
. I believe this is what it is and was just mistyped.
Post a Comment for "Reactjs - I Am Trying To Handle And Event In A Popup, But The Popup Is Not Being Rendered As It Should After An Event Execution"