Skip to content

fix(components-rn): upgrade ant design react native - #19489

Merged
Single-Dancer merged 2 commits into
NervJS:mainfrom
haiyoucuv:fix/components-rn-ant-design-portal
Sep 20, 2026
Merged

Single-Dancer merged 2 commits into
NervJS:mainfrom
haiyoucuv:fix/components-rn-ant-design-portal

Conversation

@haiyoucuv

@haiyoucuv haiyoucuv commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

这个 PR 做了什么? (简要描述所做更改)

问题

@tarojs/components-rn 当前固定依赖 @ant-design/react-native@5.0.0。该版本的 Portal.Host 在卸载时调用已废弃的 DeviceEventEmitter.removeListener()。在 React Native 0.73 中,这个方法不存在,会抛出 TypeError: undefined is not a function 并导致应用崩溃。

方案

  • 将 @ant-design/react-native 从 5.0.0 升级到 5.1.3。该版本已保存 addListener() 返回的 subscription,并在卸载时调用 subscription.remove()。
  • 补充 5.1.3 要求的 @ant-design/icons-react-native 和 react-native-gesture-handler peer/dev dependencies,避免升级后产生新的 peer dependency 缺失。
  • 更新 pnpm lockfile。

上游修复:ant-design/ant-design-mobile-rn@78cf9a9

验证

  • 使用 Node.js 20.19.5 和 pnpm 10 更新锁文件
  • pnpm install --lockfile-only --frozen-lockfile
  • 在 React Native 0.73.11 Android 环境复现并验证 Portal 卸载修复
  • 完整 workspace 测试(本机 Windows 未开启 symlink 权限)

这个 PR 是什么类型? (至少选择一个)

  • 错误修复 (Bugfix)
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

  • 功能改进
    • 优化日期选择器,支持按年份、月份或日期精度进行选择。
    • 改进时间选择器,可根据起止时间限制小时和分钟选项,并提升取消、确认及禁用状态下的交互表现。
    • 优化多列选择器的数据展示与级联选择体验。
    • 升级移动端组件库依赖,新增图标库与手势处理支持,提升兼容性和交互稳定性。

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2134ebae-287b-468e-8964-a2fa7341dd4b

📥 Commits

Reviewing files that changed from the base of the PR and between 858ce43 and bb7a8e4.

⛔ Files ignored due to path filters (1)
  • packages/taro-components-rn/src/__tests__/__snapshots__/pickerView.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (7)
  • packages/taro-components-rn/src/__tests__/picker-date-time.spec.tsx
  • packages/taro-components-rn/src/__tests__/pickerView.spec.tsx
  • packages/taro-components-rn/src/components/Picker/date.tsx
  • packages/taro-components-rn/src/components/Picker/region.tsx
  • packages/taro-components-rn/src/components/Picker/time.tsx
  • packages/taro-components-rn/src/components/PickerView/PropsType.tsx
  • packages/taro-components-rn/src/components/PickerView/index.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

更新 taro-components-rn 的 React Native 依赖声明。升级 @ant-design/react-native,新增图标和手势处理依赖,并补充对应的 peer 依赖范围。

Changes

RN 依赖更新

Layer / File(s) Summary
依赖版本与 peer 依赖声明
packages/taro-components-rn/package.json
将 @ant-design/react-native 升级到 5.1.3。新增 @ant-design/icons-react-native 和 react-native-gesture-handler 的开发依赖。新增对应的 peer 依赖范围。

Priority: ➖ Normal

Estimated code review effort: 1(简单) | ~5 分钟

Change: Bug fix

Suggested reviewers: single-dancer

Merge Risk: ⚪ Minimal · up to bb7a8

No actionable merge-blocking issue remains in the reviewed picker adaptation changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了主要变更,即升级 @ant-design/react-native 依赖,并与 PR 目标一致。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

小兔翻开依赖表,
图标手势入新家。
Ant Design 步伐快,
peer 范围写清楚。
RN 枝头添新芽。

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested a review from Single-Dancer August 28, 2026 02:30
@Single-Dancer Single-Dancer added this to the 4.2.2 milestone Sep 20, 2026
@Single-Dancer
Single-Dancer force-pushed the fix/components-rn-ant-design-portal branch from 7af089b to bb7a8e4 Compare September 20, 2026 07:27
@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.85%. Comparing base (7f02179) to head (bb7a8e4).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #19489      +/-   ##
==========================================
+ Coverage   55.70%   55.85%   +0.14%     
==========================================
  Files         451      453       +2     
  Lines       23779    23864      +85     
  Branches     5881     5914      +33     
==========================================
+ Hits        13247    13330      +83     
- Misses       8649     8785     +136     
+ Partials     1883     1749     -134     
Flag Coverage Δ
taro-cli 56.96% <ø> (ø)
taro-runtime 58.63% <ø> (ø)
taro-web 53.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../taro-components-rn/src/components/Picker/date.tsx 97.82% <100.00%> (ø)
.../taro-components-rn/src/components/Picker/time.tsx 97.43% <100.00%> (ø)
...-components-rn/src/components/PickerView/index.tsx 89.47% <100.00%> (ø)

... and 41 files with indirect coverage changes

🚀 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.

@Single-Dancer
Single-Dancer merged commit dbfb26b into NervJS:main Sep 20, 2026
25 checks passed
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.

2 participants