0

I am upgrading to react 18.2.0 but I'm getting the use createRoot error even though I am using createRoot. I see that others were having this issue around April `22. I've looked in the change logs and don't see any mention of it, but surely it has to have been fixed by now. Maybe not?

React 18 displays ReactDOM.render warning even though I switched to the new standard

Package.json

"react": "^18.2.0",
"react-color": "^2.19.3",
"react-cool-onclickoutside": "^1.6.2",
"react-csv": "^2.2.2",
"react-device-detect": "^1.17.0",
"react-dom": "^18.2.0",
"react-heap": "^0.1.3",
"react-id-generator": "^3.0.1",
"react-map-gl": "^6.1.14",
"react-map-gl-draw": "0.21.1",
"react-mapbox-gl-geocoder": "^1.1.0",
"react-mentions": "^4.4.7",
"react-phone-input-2": "^2.14.0",
"react-redux": "^7.2.3",
"react-router-dom": "^5.2.0",
"react-script-hook": "^1.5.0",
"react-scripts": "4.0.3",
"react-select": "^4.3.1",
"react-select-country-list": "^2.2.3",

index.js

import ReactDOM from 'react-dom/client';
...

const container = document.getElementById('root');
const root = ReactDOM.createRoot(container);
root.render(<App />);
bonum_cete
  • 4,730
  • 6
  • 32
  • 56
  • Where are you seeing this? When running the app or during tests? You might have a dependency that hasn't switched. – Slava Knyazev Nov 23 '22 at 19:14
  • This is when I'm running the app. Ugh! there's so many dependancies in this app – bonum_cete Nov 23 '22 at 19:49
  • You could search the code of every package for the usage of `ReactDOM.render()`, but it's really not the end of the world. It's a warning you can safely ignore (for now). – Slava Knyazev Nov 23 '22 at 19:54

0 Answers0