Repository: react-component/tooltip
Pull request #495: update destroyTooltipOnHide to destroyOnHidden
Author: login: li-jia-nan
Created: 2025-05-18T04:01:00Z | Merged: 2025-05-19T07:09:26Z



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **新功能**
  - 新增 Vercel 部署配置文件，指定使用 umijs 框架。
  - 构建输出目录现可自定义。

- **文档**
  - README 中 Tooltip 组件属性表优化格式，属性名与代码保持一致，相关描述更新。
  - 示例文档代码增加类型标注，提升可读性和类型安全性。

- **重构**
  - Tooltip 组件属性 destroyTooltipOnHide 重命名为 destroyOnHidden，相关文档、示例和测试同步更新。
  - Tooltip 组件和 Popup 组件的声明方式优化，提升类型安全和可维护性。

- **依赖升级**
  - React 及相关依赖升级至 19.x，类型定义同步更新，提升兼容性。

- **杂项**
  - .gitignore 文件优化，新增 pnpm-lock.yaml 忽略规则。
  - 删除旧的 now.json 部署配置文件。
  - 新增 GitHub Actions 工作流，实现文档自动构建和部署至 GitHub Pages。
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/.github/workflows/site-deploy.yml b/.github/workflows/site-deploy.yml
new file mode 100644
index 0000000..8f12507
--- /dev/null
+++ b/.github/workflows/site-deploy.yml
@@ -0,0 +1,39 @@
+name: Deploy website
+on:
+  push:
+    tags:
+      - '*'
+  workflow_dispatch:
+
+permissions:
+  contents: write
+
+jobs:
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - name: checkout
+        uses: actions/checkout@v3
+
+      - name: setup node
+        uses: actions/setup-node@v1
+        with:
+          node-version: 14
+
+      - name: create package-lock.json
+        run: npm i --package-lock-only --ignore-scripts
+
+      - name: Install dependencies
+        run: npm ci
+
+      - name: build Docs
+        run: npm run build
+
+      - name: Deploy to GitHub Pages
+        uses: peaceiris/actions-gh-pages@v3
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          publish_dir: ./dist
+          force_orphan: true
+          user_name: 'github-actions[bot]'
+          user_email: 'github-actions[bot]@users.noreply.github.com'
diff --git a/.gitignore b/.gitignore
index 93e1cbd..d34b985 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,15 +30,16 @@ es
 coverage
 yarn.lock
 package-lock.json
+pnpm-lock.yaml
 
 # umi
 .umi
 .umi-production
 .umi-test
-.env.local 
+.env.local
 
 # dumi
 .dumi/tmp
 .dumi/tmp-production
 
-bun.lockb
\ No newline at end of file
+bun.lockb
diff --git a/README.md b/README.md
index ae51cdc..6d843ad 100644
--- a/README.md
+++ b/README.md
@@ -72,28 +72,28 @@ Online demo: <https://react-component.github.io/tooltip/demo>
 
 ### Props
 
-| name                 | type                                      | default             | description                                                                                                                                                      |
-| -------------------- | ----------------------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| trigger              | string \| string\[]                       | 'hover'             | which actions cause tooltip shown. enum of 'hover','click','focus'                                                                                               |
-| visible              | boolean                                   | false               | whether tooltip is visible                                                                                                                                       |
-| defaultVisible       | boolean                                   | false               | whether tooltip is visible by default                                                                                                                            |
-| placement            | string                                    | 'right'             | tooltip placement. enum of 'top','left','right','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom' |
-| motion               | object                                    |                     | Config popup motion. Please ref demo for example                                                                                                                 |
-| onVisibleChange      | (visible: boolean) => void;               |                     | Callback when visible change                                                                                                                                     |
-| afterVisibleChange   | (visible: boolean) => void;               |                     | Callback after visible change                                                                                                                                    |
-| overlay              | ReactNode \| () => ReactNode              |                     | tooltip overlay content                                                                                                                                          |
-| overlayStyle         | object                                    |                     | deprecated, Please use `styles={{ root: {} }}`                                                                                                                                         |
-| overlayClassName     | string                                    |                     | deprecated, Please use `classNames={{ root: {} }}`                                                                                                                                 |
-| prefixCls            | string                                    | 'rc-tooltip'        | prefix class name of tooltip                                                                                                                                     |
-| mouseEnterDelay      | number                                    | 0                   | delay time (in second) before tooltip shows when mouse enter                                                                                                     |
-| mouseLeaveDelay      | number                                    | 0.1                 | delay time (in second) before tooltip hides when mouse leave                                                                                                     |
-| getTooltipContainer  | (triggerNode: HTMLElement) => HTMLElement | () => document.body | get container of tooltip, default to body                                                                                                                        |
-| destroyTooltipOnHide | boolean                                   | false               | destroy tooltip when it is hidden                                                                                                                                |
-| 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; body?: string;};            |                     | Semantic DOM class                                                                                                                                               |
-| styles               | styles?: {root?: React.CSSProperties;body?: React.CSSProperties;};     |                     | Semantic DOM styles                                                                                                                                              |
+| name                | type                                                               | default             | description                                                                                                                                                      |
+| ------------------- | ------------------------------------------------------------------ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| trigger             | string \| string\[]                                                | 'hover'             | which actions cause tooltip shown. enum of 'hover','click','focus'                                                                                               |
+| visible             | boolean                                                            | false               | whether tooltip is visible                                                                                                                                       |
+| defaultVisible      | boolean                                                            | false               | whether tooltip is visible by default                                                                                                                            |
+| placement           | string                                                             | 'right'             | tooltip placement. enum of 'top','left','right','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom' |
+| motion              | object                                                             |                     | Config popup motion. Please ref demo for example                                                                                                                 |
+| onVisibleChange     | (visible: boolean) => void;                                        |                     | Callback when visible change                                                                                                                                     |
+| afterVisibleChange  | (visible: boolean) => void;                                        |                     | Callback after visible change                                                                                                                                    |
+| overlay             | ReactNode \| () => ReactNode                                       |                     | tooltip overlay content                                                                                                                                          |
+| overlayStyle        | object                                                             |                     | deprecated, Please use `styles={{ root: {} }}`                                                                                                                   |
+| overlayClassName    | string                                                             |                     | deprecated, Please use `classNames={{ root: {} }}`                                                                                                               |
+| prefixCls           | string                                                             | 'rc-tooltip'        | prefix class name of tooltip                                                                                                                                     |
+| mouseEnterDelay     | number                                                             | 0                   | delay time (in second) before tooltip shows when mouse enter                                                                                                     |
+| mouseLeaveDelay     | number                                                             | 0.1                 | delay time (in second) before tooltip hides when mouse leave                                                                                                     |
+| getTooltipContainer | (triggerNode: HTMLElement) => HTMLElement                          | () => document.body | get container of tooltip, default to body                                                                                                                        |
+| destroyOnHidden     | boolean                                                            | false               | destroy tooltip when it is hidden                                                                                                                                |
+| 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; body?: string;};                     |                     | Semantic DOM class                                                                                                                                               |
+| styles              | styles?: {root?: React.CSSProperties;body?: React.CSSProperties;}; |                     | Semantic DOM styles                                                                                                                                              |
 
 ## Important Note
 
diff --git a/docs/examples/arrowContent.tsx b/docs/examples/arrowContent.tsx
index a5ed068..61d68d9 100644
--- a/docs/examples/arrowContent.tsx
+++ b/docs/examples/arrowContent.tsx
@@ -3,7 +3,8 @@ import Tooltip from 'rc-tooltip';
 import '../../assets/bootstrap_white.less';
 
 const text = <span>Tooltip Text</span>;
-const styles = {
+
+const styles: React.CSSProperties = {
   display: 'table-cell',
   height: '60px',
   width: '80px',
@@ -11,13 +12,13 @@ const styles = {
   background: '#f6f6f6',
   verticalAlign: 'middle',
   border: '5px solid white',
-} as CSSProperties;
+};
 
-const rowStyle = {
+const rowStyle: React.CSSProperties = {
   display: 'table-row',
 };
 
-const Test = () => (
+const Test: React.FC = () => (
   <div style={{ display: 'table', padding: 120 }}>
     <div style={rowStyle}>
       <Tooltip
diff --git a/docs/examples/formError.tsx b/docs/examples/formError.tsx
index cec8845..68f12a0 100644
--- a/docs/examples/formError.tsx
+++ b/docs/examples/formError.tsx
@@ -19,10 +19,8 @@ class Test extends Component {
     });
   };
 
-  handleChange = (e) => {
-    this.setState({
-      visible: !e.target.value,
-    });
+  handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+    this.setState({ visible: !e.target.value });
   };
 
   render() {
diff --git a/docs/examples/onVisibleChange.tsx b/docs/examples/onVisibleChange.tsx
index 0de15c2..fb8049b 100644
--- a/docs/examples/onVisibleChange.tsx
+++ b/docs/examples/onVisibleChange.tsx
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
 import Tooltip from 'rc-tooltip';
 import '../../assets/bootstrap.less';
 
-function preventDefault(e) {
+function preventDefault(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) {
   e.preventDefault();
 }
 
@@ -16,10 +16,8 @@ class Test extends Component {
     visible: false,
   } as TestState;
 
-  onVisibleChange = visible => {
-    this.setState({
-      visible,
-    });
+  onVisibleChange = (visible: boolean) => {
+    this.setState({ visible });
   };
 
   onDestroy = () => {
diff --git a/docs/examples/placement.tsx b/docs/examples/placement.tsx
index 987141a..087a065 100644
--- a/docs/examples/placement.tsx
+++ b/docs/examples/placement.tsx
@@ -4,6 +4,7 @@ import '../../assets/bootstrap.less';
 import Popup from '../../src/Popup';
 
 const text = <span>Tooltip Text</span>;
+
 const styles: React.CSSProperties = {
   display: 'table-cell',
   height: '60px',
@@ -14,11 +15,11 @@ const styles: React.CSSProperties = {
   border: '5px solid white',
 };
 
-const rowStyle = {
+const rowStyle: React.CSSProperties = {
   display: 'table-row',
 };
 
-const Test = () => (
+const Test: React.FC = () => (
   <>
     <div style={{ display: 'table', padding: 120 }}>
       <div style={rowStyle}>
diff --git a/docs/examples/point.tsx b/docs/examples/point.tsx
index d59ce6a..8850763 100644
--- a/docs/examples/point.tsx
+++ b/docs/examples/point.tsx
@@ -4,8 +4,8 @@ import '../../assets/bootstrap_white.less';
 
 const text = <span>Tooltip Text</span>;
 
-const Test = () => {
-  const scrollRef = React.useRef<HTMLDivElement>();
+const Test: React.FC = () => {
+  const scrollRef = React.useRef<HTMLDivElement>(null);
 
   return (
     <div style={{ padding: 10 }}>
diff --git a/docs/examples/showArrow.tsx b/docs/examples/showArrow.tsx
index 0f7f94a..bf2a97d 100644
--- a/docs/examples/showArrow.tsx
+++ b/docs/examples/showArrow.tsx
@@ -1,10 +1,10 @@
-import type { CSSProperties } from 'react';
 import React from 'react';
 import Tooltip from 'rc-tooltip';
 import '../../assets/bootstrap_white.less';
 
 const text = <span>Tooltip Text</span>;
-const styles = {
+
+const styles: React.CSSProperties = {
   display: 'table-cell',
   height: '60px',
   width: '80px',
@@ -12,13 +12,13 @@ const styles = {
   background: '#f6f6f6',
   verticalAlign: 'middle',
   border: '5px solid white',
-} as CSSProperties;
+};
 
-const rowStyle = {
+const rowStyle: React.CSSProperties = {
   display: 'table-row',
 };
 
-const Test = () => (
+const Test: React.FC = () => (
   <div style={{ display: 'table', padding: 120 }}>
     <div style={rowStyle}>
       <Tooltip placement="left" overlay={text} showArrow={false}>
diff --git a/docs/examples/simple.tsx b/docs/examples/simple.tsx
index 8cb3012..60afc2f 100644
--- a/docs/examples/simple.tsx
+++ b/docs/examples/simple.tsx
@@ -7,7 +7,7 @@ import '../../assets/bootstrap.less';
 import { placements } from '../../src/placements';
 
 interface TestState {
-  destroyTooltipOnHide: boolean;
+  destroyOnHidden: boolean;
   destroyTooltipOptions: { name: string; value: number }[];
   placement: string;
   transitionName: string;
@@ -19,7 +19,7 @@ interface TestState {
 
 class Test extends Component<any, TestState> {
   state = {
-    destroyTooltipOnHide: false,
+    destroyOnHidden: false,
     destroyTooltipOptions: [
       {
         name: "don't destroy",
@@ -95,7 +95,7 @@ class Test extends Component<any, TestState> {
   onDestroyChange = (e) => {
     const { value } = e.target;
     this.setState({
-      destroyTooltipOnHide: [false, { keepParent: false }, { keepParent: true }][value] as boolean,
+      destroyOnHidden: [false, { keepParent: false }, { keepParent: true }][value] as boolean,
     });
   };
 
@@ -137,7 +137,7 @@ class Test extends Component<any, TestState> {
           </label>
           &nbsp;&nbsp;&nbsp;&nbsp;
           <label>
-            destroyTooltipOnHide:
+            destroyOnHidden:
             <select onChange={this.onDestroyChange}>
               {this.state.destroyTooltipOptions.map(({ name, value }) => (
                 <option key={value} value={value}>
@@ -209,7 +209,7 @@ class Test extends Component<any, TestState> {
             placement={this.state.placement}
             mouseEnterDelay={0}
             mouseLeaveDelay={0.1}
-            destroyTooltipOnHide={this.state.destroyTooltipOnHide}
+            destroyOnHidden={this.state.destroyOnHidden}
             trigger={Object.keys(this.state.trigger) as ActionType[]}
             onVisibleChange={this.onVisibleChange}
             overlay={<div style={{ height: 50, width: 50 }}>i am a tooltip</div>}
diff --git a/now.json b/now.json
deleted file mode 100644
index 65cacf1..0000000
--- a/now.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "version": 2,
-  "name": "rc-tooltip",
-  "builds": [
-    {
-      "src": "package.json",
-      "use": "@now/static-build",
-      "config": { "distDir": "dist" }
-    }
-  ]
-}
diff --git a/package.json b/package.json
index 84f07b4..2786a1e 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
   "scripts": {
     "compile": "father build && lessc assets/bootstrap.less assets/bootstrap.css && lessc assets/bootstrap_white.less assets/bootstrap_white.css",
     "docs:build": "dumi build",
-    "docs:deploy": "gh-pages -d dist",
+    "docs:deploy": "npm run docs:build && gh-pages -d dist",
     "lint": "eslint src/ --ext .tsx,.ts,.jsx,.js",
     "now-build": "npm run docs:build",
     "prepare": "dumi setup",
@@ -48,10 +48,11 @@
   },
   "devDependencies": {
     "@rc-component/np": "^1.0.3",
-    "@testing-library/react": "^14.0.0",
+    "@testing-library/react": "^16.3.0",
     "@types/jest": "^29.4.0",
-    "@types/react": "^18.0.26",
-    "@types/react-dom": "^18.0.10",
+    "@types/node": "^22.15.18",
+    "@types/react": "^19.1.4",
+    "@types/react-dom": "^19.1.5",
     "@types/warning": "^3.0.0",
     "cross-env": "^7.0.0",
     "dumi": "^2.2.13",
@@ -61,12 +62,12 @@
     "gh-pages": "^3.1.0",
     "less": "^4.1.1",
     "rc-test": "^7.0.9",
-    "react": "^18.2.0",
-    "react-dom": "^18.2.0",
+    "react": "^19.1.0",
+    "react-dom": "^19.1.0",
     "typescript": "^4.0.5"
   },
   "peerDependencies": {
-    "react": ">=16.9.0",
-    "react-dom": ">=16.9.0"
+    "react": ">=18.0.0",
+    "react-dom": ">=18.0.0"
   }
 }
diff --git a/src/Popup.tsx b/src/Popup.tsx
index 2ab1184..8f38a4b 100644
--- a/src/Popup.tsx
+++ b/src/Popup.tsx
@@ -11,9 +11,16 @@ export interface ContentProps {
   bodyClassName?: string;
 }
 
-export default function Popup(props: ContentProps) {
-  const { children, prefixCls, id, overlayInnerStyle: innerStyle, bodyClassName, className, style } =
-    props;
+const Popup: React.FC<ContentProps> = (props) => {
+  const {
+    children,
+    prefixCls,
+    id,
+    overlayInnerStyle: innerStyle,
+    bodyClassName,
+    className,
+    style,
+  } = props;
 
   return (
     <div className={classNames(`${prefixCls}-content`, className)} style={style}>
@@ -27,4 +34,6 @@ export default function Popup(props: ContentProps) {
       </div>
     </div>
   );
-}
+};
+
+export default Popup;
diff --git a/src/Tooltip.tsx b/src/Tooltip.tsx
index 5092c6f..b826661 100644
--- a/src/Tooltip.tsx
+++ b/src/Tooltip.tsx
@@ -4,7 +4,7 @@ import type { ActionType, AlignType } from '@rc-component/trigger/lib/interface'
 import useId from '@rc-component/util/lib/hooks/useId';
 import classNames from 'classnames';
 import * as React from 'react';
-import { forwardRef, useImperativeHandle, useRef } from 'react';
+import { useImperativeHandle, useRef } from 'react';
 import { placements } from './placements';
 import Popup from './Popup';
 
@@ -35,7 +35,7 @@ export interface TooltipProps
   /** @deprecated Please use `classNames={{ root: {} }}` */
   overlayClassName?: string;
   getTooltipContainer?: (node: HTMLElement) => HTMLElement;
-  destroyTooltipOnHide?: boolean;
+  destroyOnHidden?: boolean;
   align?: AlignType;
   showArrow?: boolean | ArrowType;
   arrowContent?: React.ReactNode;
@@ -59,7 +59,7 @@ export interface TooltipClassNames {
 
 export interface TooltipRef extends TriggerRef {}
 
-const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
+const Tooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref) => {
   const {
     overlayClassName,
     trigger = ['hover'],
@@ -73,7 +73,7 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
     motion,
     placement = 'right',
     align = {},
-    destroyTooltipOnHide = false,
+    destroyOnHidden = false,
     defaultVisible,
     getTooltipContainer,
     overlayInnerStyle,
@@ -92,6 +92,7 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
   useImperativeHandle(ref, () => triggerRef.current);
 
   const extraProps: Partial<TooltipProps & TriggerProps> = { ...restProps };
+
   if ('visible' in props) {
     extraProps.popupVisible = props.visible;
   }
@@ -111,13 +112,11 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
   const getChildren = () => {
     const child = React.Children.only(children);
     const originalProps = child?.props || {};
-
     const childProps = {
       ...originalProps,
       'aria-describedby': overlay ? mergedId : null,
     };
-
-    return React.cloneElement(children, childProps);
+    return React.cloneElement<any>(children, childProps) as any;
   };
 
   return (
@@ -131,11 +130,11 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
       ref={triggerRef}
       popupAlign={align}
       getPopupContainer={getTooltipContainer}
-      onPopupVisibleChange={onVisibleChange}
-      afterPopupVisibleChange={afterVisibleChange}
+      onOpenChange={onVisibleChange}
+      afterOpenChange={afterVisibleChange}
       popupMotion={motion}
       defaultPopupVisible={defaultVisible}
-      autoDestroy={destroyTooltipOnHide}
+      autoDestroy={destroyOnHidden}
       mouseLeaveDelay={mouseLeaveDelay}
       popupStyle={{ ...overlayStyle, ...tooltipStyles?.root }}
       mouseEnterDelay={mouseEnterDelay}
@@ -145,6 +144,6 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
       {getChildren()}
     </Trigger>
   );
-};
+});
 
-export default forwardRef(Tooltip);
+export default Tooltip;
diff --git a/tests/index.test.tsx b/tests/index.test.tsx
index 7436ab8..9586008 100644
--- a/tests/index.test.tsx
+++ b/tests/index.test.tsx
@@ -93,7 +93,7 @@ describe('rc-tooltip', () => {
     });
   });
 
-  describe('destroyTooltipOnHide', () => {
+  describe('destroyOnHidden', () => {
     const destroyVerifyContent = async (wrapper: HTMLElement, content: string) => {
       fireEvent.click(wrapper.querySelector('.target'));
       await waitFakeTimers();
@@ -120,7 +120,7 @@ describe('rc-tooltip', () => {
     it('should only remove tooltip when value is true', async () => {
       const { container } = render(
         <Tooltip
-          destroyTooltipOnHide
+          destroyOnHidden
           trigger={['click']}
           placement="left"
           overlay={<strong className="x-content">Tooltip content</strong>}
@@ -154,7 +154,7 @@ describe('rc-tooltip', () => {
     it('should show tooltip arrow default', () => {
       const { container } = render(
         <Tooltip
-          destroyTooltipOnHide
+          destroyOnHidden
           trigger={['click']}
           placement="left"
           overlay={<strong className="x-content">Tooltip content</strong>}
@@ -168,7 +168,7 @@ describe('rc-tooltip', () => {
     it('should show tooltip arrow when showArrow is true', () => {
       const { container } = render(
         <Tooltip
-          destroyTooltipOnHide
+          destroyOnHidden
           trigger={['click']}
           placement="left"
           overlay={<strong className="x-content">Tooltip content</strong>}
@@ -183,7 +183,7 @@ describe('rc-tooltip', () => {
     it('should show tooltip arrow when showArrow is object', () => {
       const { container } = render(
         <Tooltip
-          destroyTooltipOnHide
+          destroyOnHidden
           trigger={['click']}
           placement="left"
           overlay={<strong className="x-content">Tooltip content</strong>}
@@ -201,7 +201,7 @@ describe('rc-tooltip', () => {
     it('should hide tooltip arrow when showArrow is false', () => {
       const { container } = render(
         <Tooltip
-          destroyTooltipOnHide
+          destroyOnHidden
           trigger={['click']}
           placement="left"
           overlay={<strong className="x-content">Tooltip content</strong>}
@@ -321,12 +321,12 @@ describe('rc-tooltip', () => {
     });
 
     it('should throw error when multiple children provided', () => {
-      const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => { });
+      const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
 
       expect(() => {
         render(
           // @ts-expect-error
-          <Tooltip overlay="tip" >
+          <Tooltip overlay="tip">
             <button>First</button>
             <button>Second</button>
           </Tooltip>,
@@ -337,4 +337,3 @@ describe('rc-tooltip', () => {
     });
   });
 });
-
diff --git a/vercel.json b/vercel.json
new file mode 100644
index 0000000..cc12e40
--- /dev/null
+++ b/vercel.json
@@ -0,0 +1,3 @@
+{
+  "framework": "umijs"
+}


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🔭 Outside diff range comments (1)</summary><blockquote>

<details>
<summary>docs/examples/formError.tsx (1)</summary><blockquote>

`11-14`: _🛠️ Refactor suggestion_

**为组件添加泛型以明确 Props 和 State 类型**  
当前使用 `as TestState` 进行断言，但未在 `Component` 泛型中声明 state 类型，建议改为：  
```ts
class Test extends Component<{}, TestState> {
  state: TestState = {
    visible: false,
  };
  // ...
}
```

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>tests/index.test.tsx (1)</summary><blockquote>

`157-158`: **建议移除冗余属性**：`showArrow` 系列测试中添加 `destroyOnHidden` 并不影响箭头渲染逻辑，建议移除以保持测试简洁。


Also applies to: 171-172, 186-187, 204-205

</blockquote></details>
<details>
<summary>src/Tooltip.tsx (1)</summary><blockquote>

`119-119`: **类型断言使用**

在 `React.cloneElement` 中添加了显式的类型断言 `as any`，确保类型兼容性。不过，过度使用 `any` 类型会降低类型安全性，建议考虑使用更具体的类型。

可以考虑使用更精确的类型而不是 `any`，例如：

```diff
-return React.cloneElement<any>(children, childProps) as any;
+return React.cloneElement<React.ReactElement>(children, childProps);
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 1f6f3c283420be98c3c4c4f191da0fd7df49b641 and e8f563c0174d6520ba957203feddc521f48eb744.

</details>

<details>
<summary>📒 Files selected for processing (16)</summary>

* `.dumirc.ts` (1 hunks)
* `.gitignore` (1 hunks)
* `README.md` (1 hunks)
* `docs/examples/arrowContent.tsx` (1 hunks)
* `docs/examples/formError.tsx` (1 hunks)
* `docs/examples/onVisibleChange.tsx` (2 hunks)
* `docs/examples/placement.tsx` (2 hunks)
* `docs/examples/point.tsx` (1 hunks)
* `docs/examples/showArrow.tsx` (1 hunks)
* `docs/examples/simple.tsx` (5 hunks)
* `now.json` (0 hunks)
* `package.json` (3 hunks)
* `src/Popup.tsx` (2 hunks)
* `src/Tooltip.tsx` (8 hunks)
* `tests/index.test.tsx` (7 hunks)
* `vercel.json` (1 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (1)</summary>

* now.json

</details>

<details>
<summary>🔇 Additional comments (40)</summary><blockquote>

<details>
<summary>.dumirc.ts (1)</summary>

`21-21`: **`outputPath` 配置已添加**：将文档构建产物输出至 `.doc` 目录，符合 Dumi 的自定义输出需求，与整体部署流程保持一致。

</details>
<details>
<summary>.gitignore (3)</summary>

`33-33`: **忽略 `pnpm-lock.yaml`**：项目使用 pnpm 时应忽略对应锁定文件，与其他包管理工具保持一致。

---

`39-39`: **移除 `.env.local` 后多余空格**：清理无意义字符，提升 `.gitignore` 可读性。

---

`45-45`: **忽略 `bun.lockb`**：新增 Bun 包管理器锁文件的忽略规则，适配更多包管理环境。

</details>
<details>
<summary>vercel.json (1)</summary>

`1-3`: **添加 Vercel 部署配置文件**：新建 `vercel.json` 并指定 `framework` 为 `umijs`，替换原有 `now.json`，部署配置准确无误。

</details>
<details>
<summary>docs/examples/point.tsx (1)</summary>

`7-8`: **明确组件类型及初始化 `ref`**：将 `Test` 声明为 `React.FC` 并将 `scrollRef` 初始值设为 `null`，提升类型安全，与其他示例保持一致。

</details>
<details>
<summary>tests/index.test.tsx (3)</summary>

`96-96`: **更新 `describe` 名称**：将测试集从 `destroyTooltipOnHide` 重命名为 `destroyOnHidden`，保持与组件属性一致。

---

`123-123`: **添加 `destroyOnHidden` 属性测试**：在相应用例中加入该属性，验证隐藏后销毁行为符合预期。

---

`324-324`: **抑制并恢复 `console.error` 输出**：通过 `jest.spyOn` 和 `@ts-expect-error` 注解，确保多子节点测试不会产生干扰日志并通过 TS 编译。


Also applies to: 329-329

</details>
<details>
<summary>docs/examples/formError.tsx (1)</summary>

`22-23`: **类型注解增强已正确应用**  
`handleChange` 方法已添加 `React.ChangeEvent<HTMLInputElement>` 类型注解，逻辑简洁且符合预期。

</details>
<details>
<summary>docs/examples/showArrow.tsx (3)</summary>

`7-15`: **`styles` 常量已正确使用 `React.CSSProperties` 类型注解**  
显式声明了样式对象的类型，有助于类型安全和代码可读性。

---

`17-20`: **`rowStyle` 常量已正确使用 `React.CSSProperties` 类型注解**  
对布局样式添加类型注解，保持了与其他示例的一致性。

---

`21-22`: **将 `Test` 组件声明为 `React.FC`**  
显式使用 `React.FC` 声明函数组件，符合本次 PR 的组件声明规范。

</details>
<details>
<summary>docs/examples/placement.tsx (3)</summary>

`8-16`: **`styles` 常量已正确使用 `React.CSSProperties` 类型注解**  
显式声明了样式对象的类型，与全局示例保持一致。

---

`18-20`: **`rowStyle` 常量已正确使用 `React.CSSProperties` 类型注解**  
添加类型注解后更易于维护和阅读。

---

`22-23`: **将 `Test` 组件声明为 `React.FC`**  
函数组件显式标注为 `React.FC`，与其他示例统一。

</details>
<details>
<summary>README.md (1)</summary>

`75-97`: **API 文档中的 `destroyTooltipOnHide` 已成功重命名为 `destroyOnHidden`**  
`Props` 表格已更新，确保无旧属性残留，并对默认值和描述进行了校对。

</details>
<details>
<summary>src/Popup.tsx (1)</summary>

`14-23`: **已将 `Popup` 组件统一声明为 `React.FC<ContentProps>` 并完成 props 解构**  
组件声明风格与示例文件一致，解构方式也更清晰可读。

</details>
<details>
<summary>docs/examples/simple.tsx (5)</summary>

`10-10`: **类型接口中的属性名称已更新**

将 `TestState` 接口中的属性名从 `destroyTooltipOnHide` 更改为 `destroyOnHidden`，这与组件 API 的变更保持一致。修改后的命名更简洁且语义明确。

---

`22-22`: **状态初始化中的属性名称已更新**

组件状态初始化中的属性名已从 `destroyTooltipOnHide` 更改为 `destroyOnHidden`，确保了与接口定义的一致性。

---

`98-98`: **setState 调用中的属性名称已更新**

`onDestroyChange` 方法中 `setState` 调用的属性名已从 `destroyTooltipOnHide` 更改为 `destroyOnHidden`，保持了整个组件中命名的一致性。

---

`140-140`: **UI 标签文本已更新**

界面中显示的标签文本已从 `destroyTooltipOnHide` 更改为 `destroyOnHidden`，确保了 UI 与代码的一致性。

---

`212-212`: **Tooltip 组件属性名称已更新**

传递给 `Tooltip` 组件的属性名已从 `destroyTooltipOnHide` 更改为 `destroyOnHidden`，完成了整个文件中命名的统一更新。

</details>
<details>
<summary>docs/examples/onVisibleChange.tsx (2)</summary>

`5-5`: **增加了明确的事件参数类型注解**

为 `preventDefault` 函数的事件参数添加了明确的 TypeScript 类型注解 `React.MouseEvent<HTMLAnchorElement, MouseEvent>`，提高了代码的类型安全性。

---

`19-20`: **改进了 onVisibleChange 方法的类型安全性和代码简洁性**

1. 为 `visible` 参数添加了明确的 `boolean` 类型注解
2. 简化了 `setState` 调用，使用了更简洁的对象简写语法

这些改进提高了代码的可读性和类型安全性。

</details>
<details>
<summary>package.json (4)</summary>

`34-34`: **改进了文档部署脚本**

`docs:deploy` 脚本现在会先运行 `docs:build` 再进行部署，确保部署前已生成最新的文档。

---

`51-56`: **更新了测试库和类型定义依赖**

1. 升级了 `@testing-library/react` 到 `^16.3.0`
2. 添加了 `@types/node` 依赖 
3. 将 React 相关类型更新到 v19 版本

这些更新使项目与 React 19 兼容，并提供了更好的类型支持。

---

`65-66`: **升级 React 依赖到 v19**

将 React 和 ReactDOM 的开发依赖从 v18 升级到了 v19，与前面的类型定义更新保持一致。


请确认项目中的所有组件和功能在 React 19 下都能正常工作，特别是那些依赖于可能在 React 19 中改变或废弃的 API 的部分。

---

`70-71`: **更新了 React 的 peer 依赖要求**

将 React 和 ReactDOM 的 peer 依赖从 `>=16.9.0` 提高到 `>=18.0.0`，这意味着使用此组件库的项目至少需要 React 18。


请确认这个变更是有意为之的，因为它可能影响一些尚未升级到 React 18 的项目。您可能需要在发布说明中特别提醒这一点。

</details>
<details>
<summary>docs/examples/arrowContent.tsx (3)</summary>

`7-15`: **为样式对象添加了明确的类型注解**

为 `styles` 常量添加了明确的 `React.CSSProperties` 类型注解，并移除了之前的类型断言，使代码更加清晰和类型安全。

---

`17-19`: **为 rowStyle 添加了明确的类型注解**

为 `rowStyle` 常量添加了明确的 `React.CSSProperties` 类型注解，与 `styles` 常量的类型处理保持一致。

---

`21-21`: **为组件添加了明确的 React.FC 类型**

将 `Test` 组件显式标注为 React 函数组件类型 `React.FC`，提高了代码的类型安全性和可读性。

</details>
<details>
<summary>src/Tooltip.tsx (8)</summary>

`7-7`: **导入语句调整得当**

移除了不再需要的 `forwardRef` 导入，并保留了所需的 `useImperativeHandle` 和 `useRef` hooks。此变更使导入语句更加精简。

---

`38-38`: **属性命名更加一致**

将 `destroyTooltipOnHide` 更改为 `destroyOnHidden`，使命名风格与组件库其他部分保持一致，提高了 API 的一致性。

---

`62-62`: **组件声明方式优化**

直接使用 `React.forwardRef` 声明组件，而不是先定义函数再包装，使代码更加简洁清晰。

---

`76-76`: **属性默认值同步更新**

将默认属性名称从 `destroyTooltipOnHide` 更新为 `destroyOnHidden`，保持与接口变更的一致性。

---

`95-95`: **代码格式优化**

在 `restProps` 展开后添加空行，提高了代码的可读性。

---

`133-134`: **事件处理器命名更新**

将 `onPopupVisibleChange` 和 `afterPopupVisibleChange` 更新为 `onOpenChange` 和 `afterOpenChange`，使命名更加清晰简洁，并与底层 Trigger 组件保持一致。

---

`137-137`: **属性名称同步更新**

将 `autoDestroy` 的值来源从 `destroyTooltipOnHide` 更新为 `destroyOnHidden`，确保了组件内部保持一致性。

---

`147-149`: **组件导出格式优化**

闭合括号与导出语句分开，提高了代码的可读性。

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-19T04:57:02Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 3**

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>.github/workflows/site-deploy.yml (3)</summary><blockquote>

`3-7`: **建议限定标签触发模式**  
当前 `on.push.tags: ['*']` 会对所有标签进行部署，可能引发误触。建议使用严格的语义版本格式（例如 `v*.*.*`），以只对发布版本的标签触发构建。

---

`23-25`: **确认生成 package-lock.json 步骤的必要性**  
如果仓库已包含 `package-lock.json`，`npm i --package-lock-only --ignore-scripts` 这一步只是重新生成锁文件，可考虑移除以加快 CI；如因特殊需求保留，请在注释中说明原因。

---

`32-33`: **升级 peaceiris/actions-gh-pages Action 版本（可选）**  
建议将 `peaceiris/actions-gh-pages@v3` 升级到最新的 `@v4` 版本，以获取新功能和安全修复：  
```diff
-        uses: peaceiris/actions-gh-pages@v3
+        uses: peaceiris/actions-gh-pages@v4
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 actionlint (1.7.7)</summary>

33-33: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

</details>

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between e8f563c0174d6520ba957203feddc521f48eb744 and ed1dafa797445dfe1098393cd34cf8f6f08ebe93.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `.github/workflows/site-deploy.yml` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 actionlint (1.7.7)</summary>

<details>
<summary>.github/workflows/site-deploy.yml</summary>

16-16: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

---

19-19: the runner of "actions/setup-node@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

---

33-33: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-19T05:02:50Z
user: login: zombieJ
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-19T07:08:44Z

Review comments:
diff_hunk: @@ -0,0 +1,39 @@
+name: Deploy website
+on:
+  push:
+    tags:
+      - '*'
+  workflow_dispatch:
+
+permissions:
+  contents: write
+
+jobs:
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - name: checkout
+        uses: actions/checkout@v3
+
+      - name: setup node
+        uses: actions/setup-node@v1
+        with:
+          node-version: 14
+
path: .github/workflows/site-deploy.yml
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**升级 setup-node Action 版本**  
当前使用 `actions/setup-node@v1` 已停止维护，建议升级到官方推荐的 `actions/setup-node@v3` 或更高版本，以获得最新特性和安全修复：  
```diff
-      - name: setup node
-        uses: actions/setup-node@v1
+      - name: setup node
+        uses: actions/setup-node@v3
         with:
           node-version: 14
```  



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 14
```

</details>

<!-- suggestion_end -->

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 actionlint (1.7.7)</summary>

19-19: the runner of "actions/setup-node@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In .github/workflows/site-deploy.yml around lines 18 to 22, the GitHub Action
uses the deprecated setup-node@v1 version. Update the action to use
actions/setup-node@v3 or a later stable version to ensure access to the latest
features and security patches by changing the uses field accordingly.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-19T05:02:49Z
author_association: NONE
diff_hunk: @@ -0,0 +1,39 @@
+name: Deploy website
+on:
+  push:
+    tags:
+      - '*'
+  workflow_dispatch:
+
+permissions:
+  contents: write
+
path: .github/workflows/site-deploy.yml
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**修正页面发布所需的权限配置**  
`peaceiris/actions-gh-pages` 需要 `pages: write` 权限才能正确将内容发布到 GitHub Pages，仅配置 `contents: write` 会导致部署失败。请补充如下权限：  
```diff
 permissions:
-  contents: write
+  contents: write
+  pages: write
```  



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
permissions:
  contents: write
  pages: write
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In .github/workflows/site-deploy.yml around lines 8 to 10, the permissions
section only includes 'contents: write', which is insufficient for deploying
with peaceiris/actions-gh-pages. Add 'pages: write' permission alongside
'contents: write' to ensure the action can publish content to GitHub Pages
successfully.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-19T05:02:50Z
author_association: NONE
diff_hunk: @@ -0,0 +1,39 @@
+name: Deploy website
+on:
+  push:
+    tags:
+      - '*'
+  workflow_dispatch:
+
+permissions:
+  contents: write
+
+jobs:
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - name: checkout
+        uses: actions/checkout@v3
+
+      - name: setup node
+        uses: actions/setup-node@v1
+        with:
+          node-version: 14
+
+      - name: create package-lock.json
+        run: npm i --package-lock-only --ignore-scripts
+
+      - name: Install dependencies
+        run: npm ci
+
+      - name: build Docs
+        run: npm run build
+
+      - name: Deploy to GitHub Pages
+        uses: peaceiris/actions-gh-pages@v3
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          publish_dir: ./dist
path: .github/workflows/site-deploy.yml
user: login: coderabbitai[bot]
body: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**验证 Docs 构建输出目录与发布目录的一致性**  
根据 PR 中对 `.dumirc.ts` 的调整，文档输出可能改为 `.doc` 目录，但此处 `publish_dir` 指向 `./dist`，容易导致找不到发布内容。请确认 `npm run build` 的输出路径，并同步更新：  
```diff
-          publish_dir: ./dist
+          publish_dir: ./doc   # 或者调整 build 脚本输出到 dist
```

---

🏁 Script executed:

```shell
#!/bin/bash
set -e

echo "1. 查看 package.json 中的 build 脚本："
grep -R '"build"' package.json -A2 || echo "未找到 build 脚本"

echo -e "\n2. 定位 .dumirc.ts 文件："
fd --hidden --ignore-case .dumirc.ts || echo "未找到 .dumirc.ts 文件"

echo -e "\n3. 打印 .dumirc.ts 前 200 行内容："
for f in $(fd --hidden --ignore-case .dumirc.ts); do
  echo "---- 文件: $f ----"
  sed -n '1,200p' "$f"
done
```

Length of output: 1157

---

```bash
#!/bin/bash
set -e

echo "查找项目根目录下的 package.json："
fd --ignore-case package.json || echo "未找到 package.json"

echo -e "\n打印 package.json 前 200 行内容："
sed -n '1,200p' package.json || echo "无法读取 package.json"
```

---

🏁 Script executed:

```shell
#!/bin/bash
set -e
echo "查看 package.json 中的 build 脚本："
grep -R '"build"' -A2 package.json || echo "未在 scripts 中找到 build"
```

Length of output: 163

---

```bash
#!/bin/bash
set -e

echo "打印 package.json 中的 scripts 部分及后续 50 行："
grep -R '"scripts"' -A50 package.json || echo "未找到 scripts 部分"
```

---



</details>

**请同步更新 GitHub Pages 发布目录**  
根据 `.dumirc.ts` 中 `outputPath: '.doc'`，Dumi 构建产物会输出到 `.doc`，而当前 Workflow 仍在使用 `./dist`，会导致找不到发布内容。  

需要调整：  
- 文件：`.github/workflows/site-deploy.yml`，约第 29–36 行  
- 将  
```diff
-          publish_dir: ./dist
+          publish_dir: ./.doc
```  
（或保留 `publish_dir: ./dist` 同时把 `outputPath` 恢复为 `dist`）  



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./.doc
```

</details>

<!-- suggestion_end -->

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 actionlint (1.7.7)</summary>

33-33: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In .github/workflows/site-deploy.yml around lines 29 to 36, the publish_dir for
the GitHub Pages deployment is set to ./dist, but the build output directory has
been changed to .doc in .dumirc.ts. To fix this, update the publish_dir value to
./doc to match the actual build output directory, ensuring the deployment uses
the correct folder. Alternatively, revert the outputPath in .dumirc.ts back to
dist if you want to keep publish_dir as ./dist.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-19T05:02:50Z
author_association: NONE

PR comments:
user: login: vercel[bot]
created_at: 2025-05-18T04:01:06Z
body: [vc]: #5jCZICnU6etWr8aKmkWlZvaTcBzXYYdZeSOjF+qIxhk=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ0b29sdGlwIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6InRvb2x0aXAtZ2l0LXVwZGF0ZS1hcGktcmVhY3QtY29tcG9uZW50LnZlcmNlbC5hcHAifSwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3JlYWN0LWNvbXBvbmVudC90b29sdGlwL0VZSHY3VkV4TFRxNXhwQzFRbzJVaVZ2RHNwMXciLCJwcmV2aWV3VXJsIjoidG9vbHRpcC1naXQtdXBkYXRlLWFwaS1yZWFjdC1jb21wb25lbnQudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsInJvb3REaXJlY3RvcnkiOm51bGx9XX0=
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **tooltip** | ✅ Ready ([Inspect](https://vercel.com/react-component/tooltip/EYHv7VExLTq5xpC1Qo2UiVvDsp1w)) | [Visit Preview](https://tooltip-git-update-api-react-component.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/tooltip-git-update-api-react-component.vercel.app?via=pr-comment-feedback-link) | May 19, 2025 5:03am |


author_association: NONE
user: login: coderabbitai[bot]
created_at: 2025-05-18T04:01:07Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

"""
## Walkthrough

本次变更主要包括对 Tooltip 组件及其相关示例的类型注解优化、属性命名统一（`destroyTooltipOnHide` 重命名为 `destroyOnHidden`）、依赖升级（React 及类型相关包）、构建与部署配置调整（新增 Vercel 配置、删除 now.json、更新 .dumirc.ts 输出路径）、文档和测试同步更新。

## Changes

| 文件/路径分组                                 | 变更摘要                                                                                                                     |
|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| .dumirc.ts                                    | 配置新增 `outputPath: '.doc'`，指定自定义输出目录。                                                                          |
| .gitignore                                    | 新增忽略 `pnpm-lock.yaml`，移除 `.env.local` 行尾空格，文件末尾添加换行。                                                    |
| README.md                                     | Tooltip 属性表格式优化，属性名 `destroyTooltipOnHide` 改为 `destroyOnHidden`，部分描述格式微调。                              |
| docs/examples/arrowContent.tsx<br>docs/examples/placement.tsx<br>docs/examples/showArrow.tsx<br>docs/examples/point.tsx | 显式添加 TypeScript 类型注解，组件声明统一为 `React.FC`，样式对象类型明确为 `React.CSSProperties`。                          |
| docs/examples/formError.tsx                   | `handleChange` 方法参数类型明确为 `React.ChangeEvent<HTMLInputElement>`，方法体简化为单行。                                  |
| docs/examples/onVisibleChange.tsx             | `preventDefault` 和 `onVisibleChange` 方法参数类型明确，`setState` 调用简化。                                                |
| docs/examples/simple.tsx                      | 组件及状态属性、事件处理、渲染、传递属性等，`destroyTooltipOnHide` 全部重命名为 `destroyOnHidden`。                          |
| now.json                                      | 删除部署配置文件 now.json。                                                                                                  |
| package.json                                  | 升级 React 及相关类型依赖，新增 `@types/node`，`docs:deploy` 脚本先构建后部署，peerDependencies 升级 React 版本要求。         |
| src/Popup.tsx                                 | `Popup` 组件由默认导出函数重构为命名常量 `React.FC<ContentProps>`，导出方式调整，props 解构格式优化。                        |
| src/Tooltip.tsx                               | 组件重构为内联 `React.forwardRef`，属性 `destroyTooltipOnHide` 统一重命名为 `destroyOnHidden`，事件处理属性命名同步调整。     |
| tests/index.test.tsx                          | 测试用例中 `destroyTooltipOnHide` 全部更名为 `destroyOnHidden`，console.error mock 格式微调。                                 |
| vercel.json                                   | 新增 Vercel 部署配置文件，指定框架为 "umijs"。                                                                               |
| .github/workflows/site-deploy.yml             | 新增 GitHub Actions 工作流，用于在标签推送时构建并部署网站到 GitHub Pages。                                                   |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant Tooltip
    participant Trigger
    participant Popup

    User->>Tooltip: 传递 destroyOnHidden 属性
    Tooltip->>Trigger: 传递 autoDestroy={destroyOnHidden}
    Trigger->>Popup: 控制弹层显示/销毁
    User->>Tooltip: 触发 onOpenChange/afterOpenChange 事件
    Tooltip->>Trigger: 事件重命名同步传递
```

## Suggested reviewers

- zombieJ

## Poem

> 代码如风轻轻吹，  
> Tooltip 属性换新衣。  
> 类型注解更严谨，  
> 部署脚本焕活力。  
> 兔子挥爪庆更新，  
> 🌱新版本，跃然生！
"""

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGA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VBIiaGk4gDASCd41aAZACmrcUCRkE/Gbi6A3jewGWGAlZAsJOQWgIaW8b+MsgBTCJlkAAm0AImGQBgK0B/GhNWg/jDCWkFomfiDA14lgLePvGPjdk0YVcLQG2FtR9AQAA -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

<details open="true">
<summary>🧪 Generate Unit Tests</summary>

- [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Create PR with Unit Tests
- [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Commit Unit Tests in branch `update-api`
- [ ] <!-- {"checkboxId": "07f1e7d6-8a8e-4e23-9900-8731c2c87f58", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Post Copyable Unit Tests in Comment

</details>

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=react-component/tooltip&utm_content=495):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

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)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai generate unit tests` to generate unit tests for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE
user: login: socket-security[bot]
created_at: 2025-05-18T04:01:44Z
body: **Review the following changes in direct dependencies.** Learn more about [Socket for GitHub](https://socket.dev?utm_medium=gh).

<table>
<thead>
<tr>
<th>Diff</th>
<th width="200px">Package</th>
<th align="left" width="100px">Supply Chain<br/>Security</th>
<th align="left" width="100px">Vulnerability</th>
<th align="left" width="100px">Quality</th>
<th align="left" width="100px">Maintenance</th>
<th align="left" width="100px">License</th>
</tr>
</thead>
<tbody>
<tr><td align="center"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30717712766"><img src="https://github-app-statics.socket.dev/diff-updated.svg" title="Updated" alt="Updated" width="20" height="20"></a></td><td><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30717712766">@​types/​react-dom@​18.3.7 ⏵ 19.1.5</a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30717712766"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Supply Chain Security" width="40" height="40" alt="100"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30717712766"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Vulnerability" width="40" height="40" alt="100"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30717712766"><img src="https://github-app-statics.socket.dev/score-72.svg" title="Quality" width="40" height="40" alt="72"></a> <sup>-1</sup></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30717712766"><img src="https://github-app-statics.socket.dev/score-95.svg" title="Maintenance" width="40" height="40" alt="95"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30717712766"><img src="https://github-app-statics.socket.dev/score-100.svg" title="License" width="40" height="40" alt="100"></a></td></tr>
<tr><td align="center"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30509800396"><img src="https://github-app-statics.socket.dev/diff-updated.svg" title="Updated" alt="Updated" width="20" height="20"></a></td><td><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30509800396">@​types/​react@​18.3.21 ⏵ 19.1.4</a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30509800396"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Supply Chain Security" width="40" height="40" alt="100"></a> <sup>+1</sup></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30509800396"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Vulnerability" width="40" height="40" alt="100"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30509800396"><img src="https://github-app-statics.socket.dev/score-78.svg" title="Quality" width="40" height="40" alt="78"></a> <sup>+1</sup></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30509800396"><img src="https://github-app-statics.socket.dev/score-95.svg" title="Maintenance" width="40" height="40" alt="95"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=30509800396"><img src="https://github-app-statics.socket.dev/score-100.svg" title="License" width="40" height="40" alt="100"></a></td></tr>
<tr><td align="center"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=19654696990"><img src="https://github-app-statics.socket.dev/diff-updated.svg" title="Updated" alt="Updated" width="20" height="20"></a></td><td><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=19654696990">@​testing-library/​react@​14.3.1 ⏵ 16.3.0</a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=19654696990"><img src="https://github-app-statics.socket.dev/score-99.svg" title="Supply Chain Security" width="40" height="40" alt="99"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=19654696990"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Vulnerability" width="40" height="40" alt="100"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=19654696990"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Quality" width="40" height="40" alt="100"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=19654696990"><img src="https://github-app-statics.socket.dev/score-89.svg" title="Maintenance" width="40" height="40" alt="89"></a></td><td align="left"><a href="https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies&dependency_item_key=19654696990"><img src="https://github-app-statics.socket.dev/score-100.svg" title="License" width="40" height="40" alt="100"></a></td></tr>
</tbody>
</table>

[View full report](https://socket.dev/dashboard/org/react-component/diff/8baaab0c-75ae-483a-8ef9-298c19e49ead/4e008de2-d1b5-47f7-98ec-a6e933f7c9a9?tab=dependencies)

<!-- overview-comment -->
author_association: NONE
user: login: codecov[bot]
created_at: 2025-05-18T04:03:07Z
body: ## [Codecov](https://app.codecov.io/gh/react-component/tooltip/pull/495?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=react-component) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 100.00%. Comparing base [(`1f6f3c2`)](https://app.codecov.io/gh/react-component/tooltip/commit/1f6f3c283420be98c3c4c4f191da0fd7df49b641?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=react-component) to head [(`e351c6b`)](https://app.codecov.io/gh/react-component/tooltip/commit/e351c6bc6107b0f9d02b36a53593d4a4d077323f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=react-component).
> Report is 1 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##            master      #495   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           33        33           
  Branches        12        12           
=========================================
  Hits            33        33           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/react-component/tooltip/pull/495?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=react-component).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=react-component).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
author_association: NONE