I think my calculator works really well (it took me 2 weeks!). I imported the whole project into a codepen and changed some id’s around to make it pass the user story tests, but alas it does not…
You can look at my working version here. Working calculator. I can’t be for certain but i had my Calculator directly display the element with the id=‘display’. In your example you had another component inside of calculator display it.
I added an input element with a value displaying output just as I think you have… if you check out my pen it still doesn’t pass any of those tests. maddening! Thanks for taking a peek, any other ideas would be appreciated.
I was trying to look for other peoples examples to cross with yours. Sorry I don’t see anything. It looks like its working but that test fails. very weird.
That sounds about right although I have no idea why I made it an input to begin with. I went back and looked at the instructions and it said nothing about that. Pretty annoying.
I know why I made it an input now. I looked at the example here https://codepen.io/freeCodeCamp/full/wgGVVX. which is in the instructions and saw that is how they did it. Looking at the example showed me how to pass the tests.
The example is merely showing the output prop inside a div. I’m stumped… I worked hard on this and would love to get the certificate. Does anyone know how I can get a response from someone at FCC?? I’m grateful for all the help
One thing I can see from both the working examples is that the output Class only displays the value being passed to it from state, they do not do any manipulation of data in the class. There should be only one place of truth in your app and that should be the state. Try moving your evaluation into the Calculator class and have it set the state to the answer and then passing the answer down to your Output class.
The evaluation is done entirely in inputReducer and is set in state before being passed to Output… I just commented out the formatting from the Output class to see if that affected anything. I also made sure output is always a string by changing a couple things in the inputReducer before setState. Still doesn’t pass any of those tests…