Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit 4616336

Browse files
fix: move onIndexChange (#1384)
1 parent 3566049 commit 4616336

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PanResponderAdapter.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ export default function PanResponderAdapter<T extends Route>({
8181

8282
const { timing, ...transitionConfig } = DefaultTransitionSpec;
8383

84+
onIndexChangeRef.current(index);
85+
8486
Animated.parallel([
8587
timing(panX, {
8688
...transitionConfig,
@@ -89,7 +91,6 @@ export default function PanResponderAdapter<T extends Route>({
8991
}),
9092
]).start(({ finished }) => {
9193
if (finished) {
92-
onIndexChangeRef.current(index);
9394
pendingIndexRef.current = undefined;
9495
}
9596
});

0 commit comments

Comments
 (0)