Skip to content

Commit

Permalink
feat: retire deprecated api (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
aojunhao123 authored Jan 10, 2025
1 parent ac46af1 commit e8e35fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/examples/formError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Test extends Component {
<div style={{ marginTop: 100, marginLeft: 100, marginBottom: 100 }}>
<Tooltip
visible={this.state.visible}
animation="zoom"
motion={{ motionName: 'rc-tooltip-zoom' }}
trigger={[]}
overlayStyle={{ zIndex: 1000 }}
overlay={<span>required!</span>}
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/onVisibleChange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ function preventDefault(e) {
}

interface TestState {
visible: boolean;
destroy?: boolean;
}
visible: boolean;
destroy?: boolean;
}

class Test extends Component {
state = {
Expand Down Expand Up @@ -37,7 +37,7 @@ class Test extends Component {
<div style={{ marginTop: 300, marginLeft: 100, marginBottom: 100 }}>
<Tooltip
visible={this.state.visible}
animation="zoom"
motion={{ motionName: 'rc-tooltip-zoom' }}
onVisibleChange={this.onVisibleChange}
trigger="click"
overlay={<span>I am a tooltip</span>}
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/simple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class Test extends Component<any, TestState> {
align={{
offset: [this.state.offsetX, this.state.offsetY],
}}
transitionName={this.state.transitionName}
motion={{ motionName: this.state.transitionName }}
overlayInnerStyle={state.overlayInnerStyle}
>
<div style={{ height: 100, width: 100, border: '1px solid red' }}>trigger</div>
Expand Down
10 changes: 1 addition & 9 deletions src/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ArrowType, TriggerProps, TriggerRef } from '@rc-component/trigger';
import Trigger from '@rc-component/trigger';
import type { ActionType, AlignType, AnimationType } from '@rc-component/trigger/lib/interface';
import type { ActionType, AlignType } from '@rc-component/trigger/lib/interface';
import classNames from 'classnames';
import * as React from 'react';
import { forwardRef, useImperativeHandle, useRef } from 'react';
Expand All @@ -25,10 +25,6 @@ export interface TooltipProps
defaultVisible?: boolean;
visible?: boolean;
placement?: string;
/** @deprecated Use `motion` instead */
transitionName?: string;
/** @deprecated Use `motion` instead */
animation?: AnimationType;
/** Config popup motion */
motion?: TriggerProps['popupMotion'];
onVisibleChange?: (visible: boolean) => void;
Expand Down Expand Up @@ -74,8 +70,6 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
children,
onVisibleChange,
afterVisibleChange,
transitionName,
animation,
motion,
placement = 'right',
align = {},
Expand Down Expand Up @@ -139,8 +133,6 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
getPopupContainer={getTooltipContainer}
onPopupVisibleChange={onVisibleChange}
afterPopupVisibleChange={afterVisibleChange}
popupTransitionName={transitionName}
popupAnimation={animation}
popupMotion={motion}
defaultPopupVisible={defaultVisible}
autoDestroy={destroyTooltipOnHide}
Expand Down

1 comment on commit e8e35fc

@vercel
Copy link

@vercel vercel bot commented on e8e35fc Jan 10, 2025

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

tooltip – ./

tooltip-git-master-react-component.vercel.app
tooltip-react-component.vercel.app

Please sign in to comment.