state = {
userAction: null
}
onItemClick = (item) => {
this.state.userAction = Number(item.target.id)
if (this.state.userAction === answer) {
item.target.firstChild.className = "li-btn right"
}
}
nextLevel = () => {
const { count, userAction, score } = this.state
if (count < 5 && userAction === this.state.bird.id) {
this.setState({
userAction: null,
})
}
}
onItemClick = (item) => {
const id = Number(item.target.id) // const {id, firstChild } = item.target
if (id === answer) {
item.target.firstChild.className = "li-btn right"
}
}
nextLevel = () => {
this.setState({
userAction: null,
})
}