diff --git a/packages/core/src/hooks/useTransition.tsx b/packages/core/src/hooks/useTransition.tsx index 87ec1ec7f7..dc68b8b249 100644 --- a/packages/core/src/hooks/useTransition.tsx +++ b/packages/core/src/hooks/useTransition.tsx @@ -220,16 +220,14 @@ export function useTransition( payload.from = callProp(from, t.item, i) } - const { onRest }: { onRest?: any } = payload - payload.onRest = result => { + const { onResolve } = payload + payload.onResolve = result => { + callProp(onResolve, result) + const transitions = usedTransitions.current! const t = transitions.find(t => t.key === key) if (!t) return - if (is.fun(onRest)) { - onRest(result, t) - } - // Reset the phase of a cancelled enter/leave transition, so it can // retry the animation on the next render. if (result.cancelled && t.phase != UPDATE) { diff --git a/packages/core/src/types/transition.ts b/packages/core/src/types/transition.ts index e0081d6526..7a9fffcbfb 100644 --- a/packages/core/src/types/transition.ts +++ b/packages/core/src/types/transition.ts @@ -77,10 +77,6 @@ export type UseTransitionProps = Merge< config?: | SpringConfig | ((item: Item, index: number) => AnimationProps['config']) - onRest?: ( - result: AnimationResult, - transition: TransitionState - ) => void /** * Called after a transition item is unmounted. */