From dbb683d1e413d0b3941d5e1f67ff13840e5c720c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwa=C5=9Bniewski?= Date: Thu, 1 Sep 2022 15:49:57 +0200 Subject: [PATCH] Revert "fix: move onIndexChange (#1384)" This reverts commit 4616336b768fe5082f7ba9ab7cde1c5b10c128f1. --- src/PanResponderAdapter.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PanResponderAdapter.tsx b/src/PanResponderAdapter.tsx index b99b732d..3d1964a9 100644 --- a/src/PanResponderAdapter.tsx +++ b/src/PanResponderAdapter.tsx @@ -81,8 +81,6 @@ export default function PanResponderAdapter({ const { timing, ...transitionConfig } = DefaultTransitionSpec; - onIndexChangeRef.current(index); - Animated.parallel([ timing(panX, { ...transitionConfig, @@ -91,6 +89,7 @@ export default function PanResponderAdapter({ }), ]).start(({ finished }) => { if (finished) { + onIndexChangeRef.current(index); pendingIndexRef.current = undefined; } });