I suspect I’m missing something, but I can’t tell why my (still unstyled–please forgive formatting) calculator is failing tests that it appears to pass.
I believe I am correctly implementing the requested ids for numpad buttons and operator buttons, and I have an element with ID ‘display’. Any advice would be appreciated!
Here’s a link to the site: React App (master–guileless-sfogliatella-d7eb3d.netlify.app)
And here’s a link to the repo: brentonhaerr/calculator: ReactJS calculator app (github.com)
This question (ID ‘display’) has been asked repeatedly and solved. Just scroll down the list of latest questions.
To clarify–did you look at my code and notice that there is indeed an issue with the display element’s id? It appears to look correct to me when I inspect it with developer tools:
<div id="display" class="col-11 text-end fs-1">0</div>
I can look closer if that is where the issue lies. I just don’t see it, while I did see a lot of questions about people who were passing id as a value to a react component but weren’t having it output as an HTML element (which I don’t think is my issue).
No issue with your code. Issue is with React version. Not many questions on calculator. You should find the ones that are related to your problem.
Ah, yes, you are correct. Thanks. So it’s just a bug in the test suite? Passing all 16 tests now.
Replaced the commented out section with the older render syntax below.
// const root = ReactDOM.createRoot(document.getElementById('root'));
// <App />
ReactDOM.render(<App />, document.getElementById("root"));