-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: 兼容在 React 19 环境下的 Toast 组件 #6774
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
src/utils/render.ts
Outdated
@@ -1,6 +1,6 @@ | |||
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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这么写 React 16 会挂掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zombieJ 已改为 conditional import
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
createRoot = fullClone.createRoot | ||
const { createRoot: createRootV18 } = require('react-dom/client') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样也没用,webpack 编译时也会报错。在 antd 侧也有一样的问题,这个只能通过发大版本把旧版本的 react 支持废弃掉才行。
这个能否尽快发个版啊,同样遇到这个问题了 |
版本发了吗?为什么还是不行啊 |
咋还不解决呢 |
react 19 目前不能启动 |
Close #6635