Skip to content

Commit ac10c65

Browse files
j-piaseckichrisbobbe
authored andcommitted
fix: make stack navigator work with latest gesture handler (react-navigation#10270)
With the release of Gesture Handler 2 some gesture handlers have been updated to follow state-flow more consistently across the platforms. Among them was the Pan gesture which was changed to transition to the `BEGAN` state as soon as finger touches the screen opposed to just before transitioning to the `ACTIVE` state. `@react-navigation/stack` is relying on the old behavior which may be causing some unexpected issues in apps, for example: software-mansion/react-native-gesture-handler#1801. This PR changes the swipe-back gesture to start when the Pan transitions to the`ACTIVE` state. Since previously Pan gesture was transitioning to the `BEGAN` state just before transitioning to the `ACTIVE` state this change would be compatible with older versions of Gesture Handler. chris: this is a cherry-pick of 5a19877
1 parent 5d9807f commit ac10c65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/stack/src/views/Stack/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export default class Card extends React.Component<Props> {
274274
} = this.props;
275275

276276
switch (nativeEvent.state) {
277-
case GestureState.BEGAN:
277+
case GestureState.ACTIVE:
278278
this.isSwiping.setValue(TRUE);
279279
this.handleStartInteraction();
280280
onGestureBegin?.();

0 commit comments

Comments
 (0)