"Octal Literals Not Allowed In Strict Mode" Frameworks Challenge

I’ve created the JavaScript calculator using React and it works perfectly fine but it is not satisfying the challenges and I’m confused why. The code is probably not very clean as I am still learning React but I’m looking for insight on why the tests aren’t returning complete even though, as far as I can tell, they should be. Here is the link to my codepen: https://codepen.io/joshocon/details/wvjGmdB

Looking at the challenge tests I see the error says “Octal Literals Not Allowed In Strict Mode.”

Take a look at this block of code:

  updateDisplay = (event) => {
    if (this.state.display == 0) {
      this.setState({
        display: event.target.value
      });
    }
    this.setState({
      display: (this.state.display += event.target.value),
      math: eval(this.state.display)
    });
  };

It’s an if condition but you’re not returning from the function…

What that means is that it if the display is 0, it will run that block of code then run the next line after it since you didn’t return or wrap the other block in an else.