'React Run Error Can't resolve react-dom/client
I ran my old react project and got this error:
ReactDOM render no longer supported
I tried to use createroot and got this error:
Module not found: Error: Can't resolve 'react-dom/client' in 'C:\Users\EditHamster\Documents\Projects\weather\src'
Solution 1:[1]
Try to install/update React and ReactDOM
npm i react react-dom
Or check for alias at webpack.config
resolve: {
extensions: ['.js', '.jsx'],
alias: {
'react-dom': '@hot-loader/react-dom',
},
},
If you have, remove this line
'react-dom': '@hot-loader/react-dom',
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | todevv |
