Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Online demo: <https://react-component.github.io/tooltip/demo>
| onVisibleChange | (visible: boolean) => void; | | Callback when visible change |
| afterVisibleChange | (visible: boolean) => void; | | Callback after visible change |
| overlay | ReactNode \| () => ReactNode | | tooltip overlay content |
| overlayStyle | object | | style of tooltip overlay |
| overlayStyle | object | | deprecated, Please use `styles={{ root: {} }}` |
| overlayClassName | string | | className of tooltip overlay |
| prefixCls | string | 'rc-tooltip' | prefix class name of tooltip |
| mouseEnterDelay | number | 0 | delay time (in second) before tooltip shows when mouse enter |
Expand All @@ -92,6 +92,8 @@ Online demo: <https://react-component.github.io/tooltip/demo>
| align | object | | align config of tooltip. Please ref demo for usage example |
| showArrow | boolean \| object | false | whether to show arrow of tooltip |
| zIndex | number | | config popup tooltip zIndex |
| classNames | classNames?: { root?: string; inner?: string;}; | | Semantic DOM class |
| styles | styles?: {root?: React.CSSProperties;inner?: React.CSSProperties;}; | | Semantic DOM styles |

## Important Note

Expand Down
2 changes: 2 additions & 0 deletions src/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overlayClassName 也废弃掉?

getTooltipContainer?: (node: HTMLElement) => HTMLElement;
Expand All @@ -41,6 +42,7 @@ export interface TooltipProps
showArrow?: boolean | ArrowType;
arrowContent?: React.ReactNode;
id?: string;
/** @deprecated Please use `styles={{ inner: {} }}` */
overlayInnerStyle?: React.CSSProperties;
Comment on lines +45 to 46
Copy link

@coderabbitai coderabbitai bot Nov 29, 2024

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README 里也改一下

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afc163,好的。建议在 README.md 中更新 overlayStyleoverlayInnerStyle 属性的说明,添加 @deprecated 标记,并引导用户使用新的 styles 属性。这样可以帮助用户更清晰地了解新的用法。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README 里也改一下

readme 这么改行不

Copy link

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!

zIndex?: number;
styles?: TooltipStyles;
Expand Down
Loading