Cuando presiono el botón "." para agregar el decimal, el display pasa de "0" a "undefined.". Es decir, lo agrega pero el 0 se transforma en undefined. No entiendo por qué.
state = {
displayValue:"0",
operator: null,
pendingOperation: false,
newValue: null
};
inputDot(){
const displayValue=this.displayValue;
this.setState({
displayValue: displayValue + "."
})
console.log(this.displayValue)
}
<button type="button"onClick={() => this.inputDot()}>.</button>