Answer the question
In order to leave comments, you need to log in
Why is the state only updated after the second click?
There is a ChatContainer.
constructor(props) {
super(props)
this.openCurrentUserInfo = this.openCurrentUserInfo.bind(this)
this.state = {
showCurrentUserInfo: null
}
}
openCurrentUserInfo(event, conversation, type) {
this.setState({
showCurrentUserInfo: conversation
})
console.log(this.state.showCurrentUserInfo)
}
Answer the question
In order to leave comments, you need to log in
async openCurrentUserInfo(event, conversation, type) {
await this.setState({
showCurrentUserInfo: conversation
})
console.log(this.state.showCurrentUserInfo)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question