-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
feat: retire deprecated api #768
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
概述步骤说明本次变更主要涉及标签页(Tabs)组件的重构,移除了与 变更
诗歌
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
🧹 Nitpick comments (1)
src/TabNavList/Wrapper.tsx (1)
11-13
: 建议添加函数文档注释虽然实现逻辑变得更简洁了,但建议为组件添加 JSDoc 注释,说明:
- renderTabBar 属性的用途
- 移除 panes 支持的原因
- 新的使用方式示例
建议添加如下文档:
+/** + * TabNavList 的包装组件,用于支持自定义渲染 tabBar + * @param renderTabBar - 自定义渲染函数,不再支持 panes 属性 + * @param restProps - 传递给 TabNavList 的其他属性 + */ const TabNavListWrapper: React.FC<TabNavListWrapperProps> = ({ renderTabBar, ...restProps }) => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
docs/demo/renderTabBar-use-panes.md
(0 hunks)docs/examples/renderTabBar-use-panes.tsx
(0 hunks)src/TabNavList/Wrapper.tsx
(1 hunks)src/Tabs.tsx
(0 hunks)src/interface.ts
(0 hunks)tests/index.test.tsx
(0 hunks)
💤 Files with no reviewable changes (5)
- docs/demo/renderTabBar-use-panes.md
- tests/index.test.tsx
- src/interface.ts
- docs/examples/renderTabBar-use-panes.tsx
- src/Tabs.tsx
🔇 Additional comments (2)
src/TabNavList/Wrapper.tsx (2)
6-8
: 类型定义清晰且合理!类型定义使用了 TypeScript 的工具类型,很好地处理了必需和可选属性的关系。
Line range hint
18-20
: 开发模式下的命名设置得当!为组件设置 displayName 有助于调试和开发体验,这是一个很好的实践。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #768 +/- ##
==========================================
- Coverage 98.96% 98.96% -0.01%
==========================================
Files 18 18
Lines 774 771 -3
Branches 224 227 +3
==========================================
- Hits 766 763 -3
Misses 8 8 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
文档更新
renderTabBar
相关的文档和示例文件接口变更
TabsProps
中的onNextClick
、onPrevClick
和keyboard
属性TabsProps
中新增type
属性RenderTabBarProps
接口中的panes
属性测试调整
renderTabBar
相关的测试用例重构
TabNavListWrapper
组件的渲染逻辑panes
相关的代码支持