总结

  1. 支持并发模式
  2. 复用根节点

原文

https://github.com/facebook/react/blob/main/CHANGELOG.md#react-dom-client

These new APIs are now exported from react-dom/client:

https://react.dev/reference/react-dom/client/createRoot

• If you call render on the same root more than once, React will update the DOM as necessary to reflect the latest JSX you passed. React will decide which parts of the DOM can be reused and which need to be recreated by “matching it up” with the previously rendered tree. Calling render on the same root again is similar to calling the set function on the root component: React avoids unnecessary DOM updates.