-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
type: add deprecated info #485
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更改涉及对 Changes
Possibly related PRs
Suggested reviewers
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: 1
🧹 Outside diff range and nitpick comments (1)
src/Tooltip.tsx (1)
36-37
: 废弃提示添加正确,建议补充迁移文档废弃提示的格式和内容符合规范,清晰地指导用户使用新的
styles.root
属性。建议:
- 考虑在组件文档中添加迁移指南
- 说明新旧 API 的具体差异和迁移步骤
/** @deprecated Please use `styles={{ inner: {} }}` */ | ||
overlayInnerStyle?: React.CSSProperties; |
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.
💡 Codebase verification
需要更新 README.md 中的 API 文档
README.md 中仍在展示已废弃的 overlayStyle
属性,但没有标注废弃提示或推荐使用新的 styles.inner
属性。建议:
- 在 README.md 的 API 表格中为
overlayStyle
添加废弃标记 - 添加说明引导用户使用新的
styles.inner
属性
🔗 Analysis chain
废弃提示添加正确,建议确保一致性
废弃提示的格式和内容符合规范,清晰地指导用户使用新的 styles.inner
属性。
建议确保所有相关文档和示例代码都反映这个变更。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查是否有相关的示例代码或文档需要更新
fd -e md -e mdx | xargs rg -l "overlayInnerStyle|overlayStyle"
Length of output: 87
Script:
#!/bin/bash
# Check the content of README.md and CHANGELOG.md for overlayInnerStyle usage
echo "=== README.md ==="
rg -A 3 "overlayInnerStyle|overlayStyle" README.md
echo -e "\n=== CHANGELOG.md ==="
rg -A 3 "overlayInnerStyle|overlayStyle" CHANGELOG.md
Length of output: 1304
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.
README 里也改一下
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.
@afc163,好的。建议在 README.md 中更新 overlayStyle
和 overlayInnerStyle
属性的说明,添加 @deprecated
标记,并引导用户使用新的 styles
属性。这样可以帮助用户更清晰地了解新的用法。
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.
README 里也改一下
readme 这么改行不
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
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 and nitpick comments (1)
README.md (1)
95-96
: 新增的语义化样式 API 设计合理新增的
classNames
和styles
属性采用了语义化的命名和结构,使用root
和inner
作为样式目标很直观。建议补充一个简单的示例代码,以帮助用户更好地理解如何使用这些新属性。建议在 API 表格后添加使用示例:
+ ## 样式示例 + + ```jsx + <Tooltip + styles={{ + root: { background: '#fff' }, + inner: { padding: '8px' } + }} + classNames={{ + root: 'custom-tooltip', + inner: 'custom-inner' + }} + > + <span>悬停文本</span> + </Tooltip> + ```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
README.md
(2 hunks)
🔇 Additional comments (1)
README.md (1)
85-85
: 废弃提示信息清晰明确
废弃提示信息准确指出了替代方案,有助于用户顺利迁移到新的 API。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #485 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 26 26
Branches 10 10
=========================================
Hits 26 26 ☔ View full report in Codecov by Sentry. |
@@ -33,6 +33,7 @@ export interface TooltipProps | |||
onVisibleChange?: (visible: boolean) => void; | |||
afterVisibleChange?: (visible: boolean) => void; | |||
overlay: (() => React.ReactNode) | React.ReactNode; | |||
/** @deprecated Please use `styles={{ root: {} }}` */ | |||
overlayStyle?: React.CSSProperties; | |||
overlayClassName?: string; |
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.
overlayClassName 也废弃掉?
这里面的类型是从rc里面的
Summary by CodeRabbit
新功能
styles
属性用于样式定义,替代已弃用的overlayStyle
和overlayInnerStyle
属性。classNames
属性,允许用户为root
和inner
元素指定语义化的 DOM 类名。文档