React / Javscript Calculator Help!

I feel like my code and manual interactions meet all the requirements.
But for some reason I only get 9/16 when passing the stories.

I can’t use the bundle.js on codesandbox, so everything is evaluated locally.

For example;

  1. My input clearly shows within the display but it comes up as incomplete.
  2. I can create an expression with multiple operators and get the correct answer but that also comes up as incomplete.
  3. I can append a decimal to any input, without adding multiple decimals but that comes up as incomplete.
  4. I can perform any operation with numbers containing decimals but that comes up incomplete.
  5. If I enter 2 or more operations the last one enter is considered but is incomplete.
  6. I can start a new calculation with a previous answer after pressing equal but is incomplete.
  7. I have my answers set up to 5 decimal places but comes up as incomplete.

Can someone please try it and let me know where I am going wrong?

(FCC-React Calculator - CodeSandbox)

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Challenge: Build a JavaScript Calculator

Link to the challenge:

hey man.

im no help and im also struggling with the calculator challenge but your code looks awesome. wayyy better than mine and i’m on iteration 5 of my calculator

Thanks man… It’s ok.

Took me a long time to come up with that code… I really wanted to use and understand the hook useReducer.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.