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

Commit

Permalink
fix: move onIndexChange (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak authored Sep 1, 2022
1 parent 3566049 commit 4616336
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PanResponderAdapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export default function PanResponderAdapter<T extends Route>({

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

onIndexChangeRef.current(index);

Animated.parallel([
timing(panX, {
...transitionConfig,
Expand All @@ -89,7 +91,6 @@ export default function PanResponderAdapter<T extends Route>({
}),
]).start(({ finished }) => {
if (finished) {
onIndexChangeRef.current(index);
pendingIndexRef.current = undefined;
}
});
Expand Down

0 comments on commit 4616336

Please sign in to comment.