From ede6993ee5db45fbdd1b5ffbe648dd9adb2c568e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Fri, 21 Apr 2023 11:48:59 +0800 Subject: [PATCH] refactor: adjust motion trigger order --- src/MotionThumb.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MotionThumb.tsx b/src/MotionThumb.tsx index 384aeb8..a2e26cc 100644 --- a/src/MotionThumb.tsx +++ b/src/MotionThumb.tsx @@ -116,7 +116,7 @@ export default function MotionThumb(props: MotionThumbInterface) { width: `var(--thumb-active-width)`, }; }; - const onAppearEnd = () => { + const onVisibleChanged = () => { setPrevStyle(null); setNextStyle(null); onMotionEnd(); @@ -135,7 +135,7 @@ export default function MotionThumb(props: MotionThumbInterface) { motionAppear onAppearStart={onAppearStart} onAppearActive={onAppearActive} - onAppearEnd={onAppearEnd} + onVisibleChanged={onVisibleChanged} > {({ className: motionClassName, style: motionStyle }, ref) => { const mergedStyle = {