score:1

Accepted answer
handleClick = (e) => {
    const {value} = e.target
    this.setState(state => ({ expression: state.expression + value}))
}

score:1

state = {
        expression : '',
        result : 0
}
handleClick = (e) => {
    e.preventDefault()
    this.setState({ expression: ...this.state.expression, e.target.value})
}

score:1

handleClick = (e) => {
    e.persist()
    this.setState({ expression: e.target.value })
}

score:1

this.setState({ expression: this.state.expression + e.target.value})

Related Query

More Query from same tag