Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@Encorehwang
Copy link

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

查阅了相关资料后,了解到我们项目中用的React是18版本的,在React 18以上的版本中已经不支持ReactDOM.render这个语法了,但Modal组件在创建组件实例时一些底层的逻辑还是用到了相关方法,这里是否可以升级下创建组件实例的方式?

System Info

System:
  OS: Windows 10 专业版 64-bit
  CPU: Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  Memory: 32768MB RAM

Binaries:
  Node: 16.12.0
  Yarn: 1.18.0
  npm: 8.1.0

Browsers:
  Chrome: 108.0.5359.126(正式版本)
 
npmPackages:
  "react": "^18.2.0",
  "react-dom": "^18.2.0",
  "react-final-form-hooks": "^2.0.2",
  "react-redux": "^8.0.5",
  "react-sortable-hoc": "^2.0.0",
  "tea-component": "^2.7.8",
@xughv
Copy link
Member

xughv commented Jan 16, 2023

我们在升级 React18 的过程中遇到了一些底层依赖库的其他问题,整体支持 React18 的版本应该要晚些时候才会有。

@liukai3586
Copy link


请问啥时候会开源呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants