I was messing with this for a long time but i notice in the console it tells me :“Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it’s running React 17. Learn more: https://reactjs.org/link/switch-to-createroot” So i followed the instructions and then updated the package in JS panel as well.
But maybe i missed something such as variable name or some type of syntax that has been updated that i didnt see or do. I wrote something incorrectly. CSS is not done. I wanted to get it functioning and pass tests first.
Here is my code i got going on – CodePen JS Calc
Any tips/criticisms/help or links you can provide that i should read to solve my issue would be great help. Thank you in advance!
I didn’t do any debugging of your code but you have similar results to another person who was using react 18; the tests passed on their project when run with react 17. Try using react 17 instead as there may be problems with the tests when used with react 18.
If it doesn’t work with react 17, post back with specific problems and you’ll get better help.
if you mean by react 17 this is what i used:
//https://unpkg.com/react@17.0.0-rc.3/umd/react.production.min.js
//https://unpkg.com/react-dom@17.0.0-rc.3/umd/react-dom.production.min.js"
ReactDOM.render(, document.getElementById(“root”));
when i use this way i get 12/16 correct.
Errors: Solution not in id=display, operations with decimals, able to do negative, and then ‘=’ should start new with previous value.
i mean these work when i do it manually. but maybe i dont see the flaw i may have created.
then when i used 18 i used ReactDOM.createroot and rendered.
this method i only have 9/16 for some reason. adding error of: precision, and no more than 1 decimal in a number set.
okay. so i moved my state.calulation outside of my div with id’display’ and it passes all the tests. im not sure why that stopped it but as long as it works. thanks for you response tho.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.