React calculator: 0 becomes 1

I have the following code set up. Basically all digits have an Onclick event which calls a function that setsState (displayValue by default starts at “0”):

inputDigit(digit){
  console.log(this.state.displayValue)
  const {pendingOperation, displayValue } = this.state;
   
  if(pendingOperation){
    this.setState({
      displayValue: String(digit)
    })
  }
else{
  this.setState({
    displayValue: displayValue==="0" |  displayValue + String(digit)
  }) 
  console.log(this.state.displayValue)
}
}

      <div id="number-keys">
      <button type="button"onClick={() => this.inputDigit(0)}>0</button>
      <button type="button"onClick={() => this.inputDigit(1)}>1</button>
      <button type="button"onClick={() => this.inputDigit(2)}>2</button>
      <button type="button"onClick={() => this.inputDigit(3)}>3</button> 
      <button type="button"onClick={() => this.inputDigit(4)}>4</button>
      <button type="button"onClick={() => this.inputDigit(5)}>5</button>
      <button type="button"onClick={() => this.inputDigit(6)}>6</button>
      <button type="button"onClick={() => this.inputDigit(7)}>7</button> 
      <button type="button"onClick={() => this.inputDigit(8)}>8</button>
      <button type="button"onClick={() => this.inputDigit(9)}>9</button> 
      </div>

Problem is, when I click “0” it automatically gets turned into 1. I don´t know why this happens. Any ideas?

I think the problem is here:

displayValue: displayValue==="0" | displayValue + String(digit)

You are using the binary OR (|) and not the logical OR (||). I assume that it interprets the true in the first half there as 1, and the binary '0b00000001 | 0b00000000` evaluates to ‘0b00000001’ which is 1.