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
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
#23
Open
Encorehwang opened this issue
Jan 16, 2023
· 2 comments
Describe the bug
我的项目中使用了tea-component,有个页面的逻辑是当点击某个按钮时通过Modal.confirm弹出确认框,每次当我点击按钮时浏览器控制台都会报这样的错误:
react_devtools_backend.js:4012 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
Describe the bug
我的项目中使用了tea-component,有个页面的逻辑是当点击某个按钮时通过Modal.confirm弹出确认框,每次当我点击按钮时浏览器控制台都会报这样的错误:
查阅了相关资料后,了解到我们项目中用的React是18版本的,在React 18以上的版本中已经不支持ReactDOM.render这个语法了,但Modal组件在创建组件实例时一些底层的逻辑还是用到了相关方法,这里是否可以升级下创建组件实例的方式?
System Info
The text was updated successfully, but these errors were encountered: