react版本:18.2
antd版本:4.19
报错:Use createRoot instead" occurs because the ReactDOM.render method has been deprecated. To solve the error, create a root element and use the ReactDOMClient.render method instead. This occurs since the render () method of the react-dom package is considered legacy starting react-dom version 18.
试了antd的4.17版本 4.19版本 4.19.5版本 问题都存在
解决:升级到文档上最新4.x版本:4.24.12
就可以了 不报错了
参考:
升级 React18 后 message, notification两个组件会提示警告 · Issue #34823 · ant-design/ant-design · GitHub