-
Notifications
You must be signed in to change notification settings - Fork 192
fix: ref could be passed as a prop in 19.x #623
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次提交针对 Changes
Sequence Diagram(s)sequenceDiagram
participant 调用者 as Caller
participant 支持函数 as supportRef
participant React as React 版本
调用者->>支持函数: 调用 supportRef(nodeOrComponent)
支持函数->>React: 获取 React 版本信息
alt 版本以 "19." 开头
支持函数-->>调用者: 返回 true
else
支持函数-->>调用者: 检查 nodeOrComponent 的 'ref' 属性
end
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/ref.ts (1)
1-1
: 修复类型导入问题当前的类型导入方式阻止了对
React.version
的访问。需要将 type-only 导入改为常规导入。建议应用以下修改:
-import type * as React from 'react'; +import * as React from 'react';Also applies to: 48-48
🧹 Nitpick comments (1)
src/ref.ts (1)
40-75
: 完善版本兼容性文档建议在函数文档中添加版本兼容性说明,以帮助使用者理解不同 React 版本下的行为差异。
建议在函数开头添加以下文档:
+/** + * 检查组件是否支持 ref + * @param nodeOrComponent - 要检查的节点或组件 + * @returns 是否支持 ref + * + * @version + * - React 19.x: 所有 React 元素都支持 ref + * - React 16.x-18.x: 需要通过 forwardRef 或类组件支持 + */ export const supportRef = (nodeOrComponent: any): boolean => {🧰 Tools
🪛 GitHub Check: CodeQL
[failure] 48-48: Property access on null or undefined
The base expression of this property access is always undefined.🪛 GitHub Actions: ✅ test
[error] 48-48: 'React' cannot be used as a value because it was imported using 'import type'.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/ref.ts
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
src/ref.ts
[failure] 48-48: Property access on null or undefined
The base expression of this property access is always undefined.
🪛 GitHub Actions: ✅ test
src/ref.ts
[error] 48-48: 'React' cannot be used as a value because it was imported using 'import type'.
🔇 Additional comments (1)
src/ref.ts (1)
45-51
: 🛠️ Refactor suggestion优化 React 版本检查逻辑
当前的版本检查方式存在以下问题:
- 假设所有 19.x 版本都支持此特性
- 没有处理
React.version
可能为 undefined 的情况- 对未来版本的兼容性存在隐患
建议改进实现方式:
if ( isReactElement(nodeOrComponent) && - React.version.startsWith('19.') + React.version?.split('.')?.[0] === '19' ) { return true; }✅ Verification successful
🌐 Web query:
React 19 中 ref 的处理方式有什么变化?是否所有 19.x 版本都支持这个新特性?
💡 Result:
React 19 对 `ref` 的处理进行了重大改进,简化了函数组件中的使用方式并引入了新功能。以下是主要变化及版本支持情况: ### `ref` 处理的核心变化 1. **函数组件直接接收 `ref` 属性** - 不再需要 `forwardRef` 包裹函数组件 - 可直接通过 props 接收 `ref`: ```jsx function MyInput({ placeholder, ref }) { return <input placeholder={placeholder} ref={ref} /> } ``` [1][2][5][6] 2. **弃用 `forwardRef`** - React 团队已提供 codemod 工具自动迁移旧代码 - 未来版本将完全移除该 API [1][5][8] 3. **类组件的特殊处理** - `ref` 不会作为 props 传递给类组件(仍指向组件实例)[1][7] 4. **新的 ref 清理机制** - ref 回调可返回清理函数(替代旧的传 `null` 模式) ```jsx <div ref={(el) => { // 挂载时执行 return () => { /* 卸载时执行的清理逻辑 */ } }} /> ``` - TypeScript 现在强制要求显式处理返回值 [3][7] ### 版本支持情况 - **全版本兼容**:这些改进从 React v19.0.0 开始提供支持 - **逐步弃用策略**: 1. `forwardRef` 在 v19.x 系列中仍可用(但会显示弃用警告) 2. refs 传 `null` 的旧模式将在后续小版本中被禁用 [1][7] ### TypeScript 适配要求 - ref 回调必须使用显式返回语句: ```diff - <div ref={el => (this.element = el)} /> + <div ref={el => { this.element = el }} /> ``` 可通过官方提供的 `no-implicit-ref-callback-return` codemod 自动转换 [1][7] 这些改进旨在简化 refs 的使用流程并减少样板代码,所有 React v19.x 系列版本均原生支持新特性。开发者在升级时应注意官方提供的 codemod 工具和类型检查提示来完成平稳迁移。 Citations: - 1: https://zh-hans.react.dev/blog/2024/12/05/react-19 - 2: https://sorrycc.com/react-19/ - 3: https://juejin.cn/post/7457465059905880073 - 4: https://blog.csdn.net/2401_86337335/article/details/142755570 - 5: https://juejin.cn/post/7445236889647349811 - 6: https://www.51cto.com/article/787273.html - 7: https://reactjs.ac.cn/blog/2024/12/05/react-19 - 8: https://blog.csdn.net/React_Community/article/details/144361551 - 9: https://blog.csdn.net/xgangzai/article/details/144335337 - 10: https://juejin.cn/post/7366526529521008652
优化 React 版本检查逻辑
当前的版本检查方式存在问题:
- 直接调用 React.version.startsWith('19.') 在 React.version 为 undefined 时会报错;
- 依赖 startsWith 方法可能不能严格保证只匹配主版本号,长期来看存在隐患。
鉴于 React 19 系列自 19.0.0 起均支持新特性,建议采取如下改进方案,以确保:
- 安全处理可能为 undefined 的 React.version;
- 更精确地只判断主版本号是否为 19。
改进方案:
if ( isReactElement(nodeOrComponent) && - React.version.startsWith('19.') + React.version?.split('.')?.[0] === '19' ) { return true; }🧰 Tools
🪛 GitHub Check: CodeQL
[failure] 48-48: Property access on null or undefined
The base expression of this property access is always undefined.🪛 GitHub Actions: ✅ test
[error] 48-48: 'React' cannot be used as a value because it was imported using 'import type'.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #623 +/- ##
==========================================
+ Coverage 90.01% 90.11% +0.10%
==========================================
Files 36 36
Lines 881 880 -1
Branches 290 302 +12
==========================================
Hits 793 793
+ Misses 86 85 -1
Partials 2 2 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/ref-19.test.tsx (1)
80-94
: 建议增强测试覆盖率当前测试用例有以下几点可以改进:
- 测试名称建议更具描述性,比如
supportRef should return true for functional components in React 19
- 缺少以下场景的测试:
- 组件显式提供 ref prop 的情况
- 类组件的情况
- 无效组件的错误处理
建议添加如下测试用例:
+ it('supportRef with explicit ref prop', () => { + const Demo = React.forwardRef<HTMLDivElement>((_, ref) => <div ref={ref} />); + + const Checker = ({ children }: { children: React.ReactElement }) => { + return <p>{String(supportRef(children))}</p>; + }; + + const { container } = render( + <Checker> + <Demo /> + </Checker>, + ); + + expect(container.querySelector('p')?.textContent).toBe('true'); + }); + + it('supportRef with class component', () => { + class Demo extends React.Component { + render() { + return <div />; + } + } + + const Checker = ({ children }: { children: React.ReactElement }) => { + return <p>{String(supportRef(children))}</p>; + }; + + const { container } = render( + <Checker> + <Demo /> + </Checker>, + ); + + expect(container.querySelector('p')?.textContent).toBe('true'); + }); + + it('supportRef with invalid element', () => { + const Checker = ({ children }: { children: any }) => { + return <p>{String(supportRef(children))}</p>; + }; + + const { container } = render( + <Checker> + {null} + </Checker>, + ); + + expect(container.querySelector('p')?.textContent).toBe('false'); + });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/ref.ts
(2 hunks)tests/ref-19.test.tsx
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/ref.ts
🔇 Additional comments (1)
tests/ref-19.test.tsx (1)
3-3
: 导入语句看起来不错!新增的
supportRef
导入与相关的 ref 工具函数放在一起,符合代码组织规范。
* fix: ref could be passed as a prop in 19.x close ant-design/ant-design#52282 * Update ref.ts * test: add test case --------- Co-authored-by: 二货机器人 <smith3816@gmail.com>
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [antd](https://ant.design) ([source](https://redirect.github.com/ant-design/ant-design)) | [`5.23.3` -> `5.24.0`](https://renovatebot.com/diffs/npm/antd/5.23.3/5.24.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ant-design/ant-design (antd)</summary> ### [`v5.24.0`](https://redirect.github.com/ant-design/ant-design/releases/tag/5.24.0) [Compare Source](https://redirect.github.com/ant-design/ant-design/compare/5.23.4...5.24.0) - 🆕 Notification support `actions` prop and deprecated `btn` prop. [#​52703](https://redirect.github.com/ant-design/ant-design/pull/52703) [@​thinkasany](https://redirect.github.com/thinkasany) - 🆕 Carousel support show dot duration. [#​52672](https://redirect.github.com/ant-design/ant-design/pull/52672) [@​yellowryan](https://redirect.github.com/yellowryan) - 🆕 Input.OTP support `separator` prop. [#​52668](https://redirect.github.com/ant-design/ant-design/pull/52668) [@​HaceraI](https://redirect.github.com/HaceraI) - 🆕 Descriptions add `labelColor` component token. [#​52700](https://redirect.github.com/ant-design/ant-design/pull/52700) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🆕 Segmented supports `shape="round"`. [#​52685](https://redirect.github.com/ant-design/ant-design/pull/52685) [@​afc163](https://redirect.github.com/afc163) - 🆕 ConfigProvider support `variant` for Card. [#​52552](https://redirect.github.com/ant-design/ant-design/pull/52552) [@​thinkasany](https://redirect.github.com/thinkasany) - 🆕 Progress/Step supports custom rounding with `rounding` prop. [#​52017](https://redirect.github.com/ant-design/ant-design/pull/52017) [@​yanghoxom](https://redirect.github.com/yanghoxom) - 🆕 Divider `orientation` support `start` and `end`. [#​52567](https://redirect.github.com/ant-design/ant-design/pull/52567) [@​li-jia-nan](https://redirect.github.com/li-jia-nan) - 🆕 Add `underlined` to `variant` of Input, InputNumber, Mentions, Form, Select, Cascader, TreeSelect, DatePicker and TimePicker. [#​52546](https://redirect.github.com/ant-design/ant-design/pull/52546) [@​ustcfury](https://redirect.github.com/ustcfury) - 🆕 ConfigProvider support global config of Modal `centered` . [#​52343](https://redirect.github.com/ant-design/ant-design/pull/52343) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🆕 Add `label` class name for Checkbox and Radio. [#​52322](https://redirect.github.com/ant-design/ant-design/pull/52322) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🐞 Fix Tooltip/Popover/Popconfirm/Dropdown misaligned popup positions with custom children in React 19. [react-component/util#623](https://redirect.github.com/react-component/util/pull/623) [@​zombieJ](https://redirect.github.com/zombieJ) - 🐞 Fix DatePicker.RangePicker arrow position when popup auto adjust position. [#​52719](https://redirect.github.com/ant-design/ant-design/pull/52719) [@​zombieJ](https://redirect.github.com/zombieJ) - 🐞 Update locale `filterCheckall` to `filterCheckAll`. [#​52517](https://redirect.github.com/ant-design/ant-design/pull/52517) [@​thinkasany](https://redirect.github.com/thinkasany) - 🐞 Fix Form that `scrollToField` and `scrollToFirstError` cannot focus components of antd. [#​52726](https://redirect.github.com/ant-design/ant-design/pull/52726) [@​Wxh16144](https://redirect.github.com/Wxh16144) - 💄 Fix Button shadow color appearing awkward on dark backgrounds. [#​52701](https://redirect.github.com/ant-design/ant-design/pull/52701) [@​afc163](https://redirect.github.com/afc163) - 💄 Fixed the unnatural animation transition effect of Segmented component in dark mode. [#​52708](https://redirect.github.com/ant-design/ant-design/pull/52708) [@​yellowryan](https://redirect.github.com/yellowryan) - 💄 Separate style of Input and TextArea. [#​52570](https://redirect.github.com/ant-design/ant-design/pull/52570) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 💄 Fix Input and Select style issue under css var mode. [#​52554](https://redirect.github.com/ant-design/ant-design/pull/52554) [@​li-jia-nan](https://redirect.github.com/li-jia-nan) - ⌨️ Remove role="alert" from Form field error to improve screen reader experience. [#​52661](https://redirect.github.com/ant-design/ant-design/pull/52661) [@​mellis481](https://redirect.github.com/mellis481) - ⌨️ Improve accessibility by adding localized labels for empty table header and panel buttons. [#​52689](https://redirect.github.com/ant-design/ant-design/pull/52689) [@​aojunhao123](https://redirect.github.com/aojunhao123) - ⌨️ Improve Tabs accessibility by fixing error `Certain ARIA roles must contain particular children`. [#​52677](https://redirect.github.com/ant-design/ant-design/pull/52677) [@​afc163](https://redirect.github.com/afc163) - ⌨️ Add screen reader support for Tooltip. [#​52293](https://redirect.github.com/ant-design/ant-design/pull/52293) [@​aojunhao123](https://redirect.github.com/aojunhao123) - TypeScript - 🤖 Separate type of Button `onClick` event by `href`. [#​52654](https://redirect.github.com/ant-design/ant-design/pull/52654) [@​Brew-Brew](https://redirect.github.com/Brew-Brew) - 🤖 Deprecate Button.Group, prefer Space.Compact. [#​52572](https://redirect.github.com/ant-design/ant-design/pull/52572) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🤖 Deprecate Input.Group, prefer Space.Compact. [#​52571](https://redirect.github.com/ant-design/ant-design/pull/52571) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🤖 Tooltip export TooltipRef type. [#​49230](https://redirect.github.com/ant-design/ant-design/pull/49230) [@​nuintun](https://redirect.github.com/nuintun) *** - 🆕 Notification 支持 `actions` 属性并废弃 `btn` 属性。[#​52703](https://redirect.github.com/ant-design/ant-design/pull/52703) [@​thinkasany](https://redirect.github.com/thinkasany) - 🆕 Carousel 支持展示指示点进度。[#​52672](https://redirect.github.com/ant-design/ant-design/pull/52672) [@​yellowryan](https://redirect.github.com/yellowryan) - 🆕 Input.OTP 支持 `separator` 属性。[#​52668](https://redirect.github.com/ant-design/ant-design/pull/52668) [@​HaceraI](https://redirect.github.com/HaceraI) - 🆕 Descriptions 增加 `labelColor` 组件 token。[#​52700](https://redirect.github.com/ant-design/ant-design/pull/52700) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🆕 Segmented 支持 `shape="round"` 的胶囊形状的样式。[#​52685](https://redirect.github.com/ant-design/ant-design/pull/52685) [@​afc163](https://redirect.github.com/afc163) - 🆕 ConfigProvider 支持 Card 组件的 `variant` 配置。[#​52552](https://redirect.github.com/ant-design/ant-design/pull/52552) [@​thinkasany](https://redirect.github.com/thinkasany) - 🆕 Progress/Step 支持使用 `rounding` 属性自定义取整方法。[#​52017](https://redirect.github.com/ant-design/ant-design/pull/52017) [@​yanghoxom](https://redirect.github.com/yanghoxom) - 🆕 Divider 的 `orientation` 属性支持 `start` 和 `end`.[#​52567](https://redirect.github.com/ant-design/ant-design/pull/52567) [@​li-jia-nan](https://redirect.github.com/li-jia-nan) - 🆕 为 Input、InputNumber、Mentions、Form、Select、Cascader、TreeSelect、DatePicker、TimePicker 组件的 `variant` 添加 `underlined` 属性。[#​52546](https://redirect.github.com/ant-design/ant-design/pull/52546) [@​ustcfury](https://redirect.github.com/ustcfury) - 🆕 ConfigProvider 支持 Modal `centered` 全局配置。[#​52343](https://redirect.github.com/ant-design/ant-design/pull/52343) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🆕 为 Checkbox 和 Radio 增加 `label` 类名。[#​52322](https://redirect.github.com/ant-design/ant-design/pull/52322) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🐞 修复 Tooltip/Popover/Popconfirm/Dropdown 在 React 19 下 children 为自定义组件时弹层位置错乱的问题。[react-component/util#623](https://redirect.github.com/react-component/util/pull/623) [@​zombieJ](https://redirect.github.com/zombieJ) - 🐞 修复 DatePicker.RangePicker 弹出窗体自动调整位置时,面板的箭头位置不正确的问题。[#​52719](https://redirect.github.com/ant-design/ant-design/pull/52719) [@​zombieJ](https://redirect.github.com/zombieJ) - 🐞 修正 locale 中 `filterCheckall` 为 `filterCheckAll`。[#​52517](https://redirect.github.com/ant-design/ant-design/pull/52517) [@​thinkasany](https://redirect.github.com/thinkasany) - 🐞 修复 Form `scrollToField` 和 `scrollToFirstError` 无法聚焦 antd 组件的问题。[#​52726](https://redirect.github.com/ant-design/ant-design/pull/52726) [@​Wxh16144](https://redirect.github.com/Wxh16144) - 💄 修复 Button 预设值按钮的阴影色在暗色背景下显示突兀的问题。[#​52701](https://redirect.github.com/ant-design/ant-design/pull/52701) [@​afc163](https://redirect.github.com/afc163) - 💄 修复 Segmented 组件在暗黑模式下的动画过渡效果不自然的问题。[#​52708](https://redirect.github.com/ant-design/ant-design/pull/52708) [@​yellowryan](https://redirect.github.com/yellowryan) - 💄 拆分 Input 和 TextArea 样式。[#​52570](https://redirect.github.com/ant-design/ant-design/pull/52570) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 💄 修复 Input 和 Select 在 css var 模式下的样式问题。[#​52554](https://redirect.github.com/ant-design/ant-design/pull/52554) [@​li-jia-nan](https://redirect.github.com/li-jia-nan) - ⌨️ Form field error 移除 role="alert" 以提升可访问性。[#​52661](https://redirect.github.com/ant-design/ant-design/pull/52661) [@​mellis481](https://redirect.github.com/mellis481) - ⌨️ 优化无障碍体验,为空表头和面板按钮添加本地化标签。[#​52689](https://redirect.github.com/ant-design/ant-design/pull/52689) [@​aojunhao123](https://redirect.github.com/aojunhao123) - ⌨️ 优化 Tabs 组件的可访问性,修复 `Certain ARIA roles must contain particular children` 的报错。[#​52677](https://redirect.github.com/ant-design/ant-design/pull/52677) [@​afc163](https://redirect.github.com/afc163) - ⌨️ 为 Tooltip 添加读屏器支持。[#​52293](https://redirect.github.com/ant-design/ant-design/pull/52293) [@​aojunhao123](https://redirect.github.com/aojunhao123) - TypeScript - 🤖 Button 根据 `href` 属性区分 `onClick` 事件类型。[#​52654](https://redirect.github.com/ant-design/ant-design/pull/52654) [@​Brew-Brew](https://redirect.github.com/Brew-Brew) - 🤖 废弃 Button.Group, 推荐 Space.Compact。[#​52572](https://redirect.github.com/ant-design/ant-design/pull/52572) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🤖 废弃 Input.Group,推荐 Space.Compact。[#​52571](https://redirect.github.com/ant-design/ant-design/pull/52571) [@​guoyunhe](https://redirect.github.com/guoyunhe) - 🤖 Tooltip 导出 TooltipRef 类型。[#​49230](https://redirect.github.com/ant-design/ant-design/pull/49230) [@​nuintun](https://redirect.github.com/nuintun) ### [`v5.23.4`](https://redirect.github.com/ant-design/ant-design/releases/tag/5.23.4) [Compare Source](https://redirect.github.com/ant-design/ant-design/compare/5.23.3...5.23.4) 蛇年第一个版本,开工大吉!🐍 - 🐞 修复 `Pagination` 可访问性问题,补充缺失的 ARIA 属性支持。[#​52616](https://redirect.github.com/ant-design/ant-design/pull/52616) [@​aojunhao123](https://redirect.github.com/aojunhao123) - 🐞 Space.Compact 支持 textarea 组件。[#​52639](https://redirect.github.com/ant-design/ant-design/pull/52639) [@​Can-Chen](https://redirect.github.com/Can-Chen) - 🐞 修复 Menu `theme="dark"` 时水平菜单的文字色和背景色同色的问题。[#​52617](https://redirect.github.com/ant-design/ant-design/pull/52617) [@​afc163](https://redirect.github.com/afc163) - 🇪🇬 Tour 增加阿拉伯文(埃及) (ar_EG) 的翻译。 [#​52642](https://redirect.github.com/ant-design/ant-design/pull/52642) [@​Sagie501](https://redirect.github.com/Sagie501) - 🇮🇱 Tour 增加以色列的国际化翻译。[#​52641](https://redirect.github.com/ant-design/ant-design/pull/52641) [@​Sagie501](https://redirect.github.com/Sagie501) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/jaegertracing/jaeger-ui). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNjQuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE2NC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJjaGFuZ2Vsb2c6ZGVwZW5kZW5jaWVzIl19--> --------- Signed-off-by: Mend Renovate <bot@renovateapp.com> Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <github@ysh.us>
close ant-design/ant-design#52282 (comment)
Summary by CodeRabbit
supportRef
函数添加了新测试用例,以验证在未提供 ref 的情况下的行为。