You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first time I used "npx create-react-app my-app", it didn't work well -- after I used it, the "react" version I got was "^0.14.0", while the version of "react-dom" was "^18.0.0".
"react": "^0.14.0",
"react-dom": "^18.0.0",
I ran "npm start", and "http://localhost:3000/" was a blank page. There were errors, saying something like "react has to be within range".
I searched online with keywords, "what does package.json look like in a react project", and it showed that the version of "react" should be the SAME as that of "react-dom".
So I changed the version of "react" from "^0.14.0" to "^18.0.0":
"react": "^18.0.0",
"react-dom": "^18.0.0",
And I also deleted "package-lock.json" and "node_modules"(maybe it was not necessary), reran "npm i". After that I ran "npm start" again, and this time the project started to work properly.
There must be something wrong with the current "create-react-app" app.
I'm not sure anybody would even notice this post. But I hope somebody would.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I just started with React.
The first time I used "npx create-react-app my-app", it didn't work well -- after I used it, the "react" version I got was "^0.14.0", while the version of "react-dom" was "^18.0.0".
I ran "npm start", and "http://localhost:3000/" was a blank page. There were errors, saying something like "react has to be within range".
I searched online with keywords, "what does package.json look like in a react project", and it showed that the version of "react" should be the SAME as that of "react-dom".
So I changed the version of "react" from "^0.14.0" to "^18.0.0":
And I also deleted "package-lock.json" and "node_modules"(maybe it was not necessary), reran "npm i". After that I ran "npm start" again, and this time the project started to work properly.
There must be something wrong with the current "create-react-app" app.
I'm not sure anybody would even notice this post. But I hope somebody would.
Thanks.
Regards,
William
Beta Was this translation helpful? Give feedback.
All reactions