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

备稿计划: React v18.0 #113

Open
iugo opened this issue Apr 27, 2022 · 0 comments
Open

备稿计划: React v18.0 #113

iugo opened this issue Apr 27, 2022 · 0 comments

Comments

@iugo
Copy link
Member

iugo commented Apr 27, 2022

React 刚发布了 18.1.0 版本.

新版本主要修复了一些问题, 增强易用性.

随着新版本的试用与逐步稳定, 我们可以考虑迁移了.

首先需要看看上个月的官方文档: https://reactjs.org/blog/2022/03/29/react-v18.html

看正式发布的文章之前, 我们应该看看前文 如何升级到 React 18.

如何升级到 React 18 (How to Upgrade to React 18)

首先我们需要的是:

更新客户端渲染 API / Updates to Client Rendering APIs

  1. 弃用 react-dom 的 render 函数. 需要使用 createRoot 函数替换.
  2. 弃用 unmountComponentAtNode. 需要使用 .unmount 方法替换.
  3. 弃用 react-dom 的 hydrate 函数. 需要使用 hydrateRoot 函数替换.
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

1 participant