Skip to content

Conversation

@lujun2
Copy link

@lujun2 lujun2 commented Nov 1, 2024

Close #6635

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2024

Preview is ready

@codecov
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.70%. Comparing base (2a70c91) to head (1300225).
Report is 41 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6774   +/-   ##
=======================================
  Coverage   92.70%   92.70%           
=======================================
  Files         335      335           
  Lines        7199     7200    +1     
  Branches     1767     1768    +1     
=======================================
+ Hits         6674     6675    +1     
  Misses        517      517           
  Partials        8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

import type { ReactElement } from 'react'
import * as ReactDOM from 'react-dom'
import type { Root } from 'react-dom/client'
import { type Root, createRoot as createClientRoot } from 'react-dom/client'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这么写 React 16 会挂掉

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zombieJ 已改为 conditional import

if (mainVersion >= 18) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
createRoot = fullClone.createRoot
const { createRoot: createRootV18 } = require('react-dom/client')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样也没用,webpack 编译时也会报错。在 antd 侧也有一样的问题,这个只能通过发大版本把旧版本的 react 支持废弃掉才行。

@Me-UserName
Copy link

这个能否尽快发个版啊,同样遇到这个问题了

@zsh1111111111111
Copy link

版本发了吗?为什么还是不行啊

@lovewinders
Copy link

咋还不解决呢

@joebnb
Copy link

joebnb commented Dec 11, 2024

react 19 目前不能启动

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

Successfully merging this pull request may close these issues.

React 19 RC react-dom 不再导出 createRoot

6 participants