-
-
Notifications
You must be signed in to change notification settings - Fork 226
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: use rc-util getNodeRef
to resolve React 19 warning
#502
Conversation
Walkthrough此次更改涉及两个主要文件。首先, Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (3)src/TriggerWrapper.tsx (2)
从 rc-util 中导入
将
✅ Verification successful代码库中已经完全移除了不安全的 ref 访问方式 通过验证,我们发现:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# 验证是否还有其他地方使用不安全的 ref 访问方式
rg "as any\.ref"
Length of output: 18 Script: #!/bin/bash
# 搜索所有可能的不安全 ref 访问模式
rg -i "\.ref\s+as\s+any"
# 搜索 getNodeRef 的使用情况
ast-grep --pattern 'getNodeRef($_)'
# 搜索可能的 ref 类型转换
rg "as\s+.*Ref"
# 查找 getNodeRef 函数的定义
ast-grep --pattern 'function getNodeRef'
Length of output: 218 Script: #!/bin/bash
# 搜索 getNodeRef 的导入来源
rg "import.*getNodeRef"
# 搜索其他可能的 ref 相关工具函数
ast-grep --pattern 'export function $_(ref)'
# 查找可能存在的 ref 相关类型定义
rg "type.*Ref"
Length of output: 428 package.json (1)
将 rc-util 升级到 ^5.44.0 版本以支持
✅ Verification successfulrc-util 版本更新验证完成 经过验证,此版本更新是合理的:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# 检查 rc-util 的版本历史和变更日志
gh api repos/react-component/util/releases | jq -r '.[].tag_name' | head -n 5
Length of output: 119 Script: #!/bin/bash
# 检查代码库中使用 getNodeRef 的情况
rg "getNodeRef" -A 2
# 检查 rc-util 的 changelog 内容
gh api repos/react-component/util/releases | jq -r '.[] | select(.tag_name == "v5.44.0" or .tag_name == "v5.38.0") | {tag: .tag_name, body: .body}'
Length of output: 1307 Script: #!/bin/bash
# 检查 rc-util 5.38.0 到 5.44.0 之间的所有版本变更记录
gh api repos/react-component/util/releases | jq -r '.[] | select(.tag_name | startswith("v5.") and (.[2:] | tonumber) >= 38 and (.[2:] | tonumber) <= 44) | {tag: .tag_name, body: .body}' | grep -A 5 "Ref"
# 检查代码中是否有其他依赖 rc-util 的相关引用
rg "from 'rc-util" -B 1 -A 1
Length of output: 4504 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #502 +/- ##
=======================================
Coverage 97.75% 97.75%
=======================================
Files 13 13
Lines 800 800
Branches 235 239 +4
=======================================
Hits 782 782
Misses 18 18 ☔ View full report in Codecov by Sentry. |
ref ant-design/ant-design#49267
Summary by CodeRabbit
rc-util
的版本。TriggerWrapper
组件中改进了子组件引用的处理方式。