From e3326aaa56190e81e3812694dabbb2cc73e4ee14 Mon Sep 17 00:00:00 2001 From: James Bechet Date: Mon, 4 Jun 2018 16:55:26 -0400 Subject: [PATCH] fix swipe to go back by providing the index (#4409) --- .../react-navigation/src/views/StackView/StackViewLayout.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-navigation/src/views/StackView/StackViewLayout.js b/packages/react-navigation/src/views/StackView/StackViewLayout.js index 2d1f58a3..60c8c85f 100644 --- a/packages/react-navigation/src/views/StackView/StackViewLayout.js +++ b/packages/react-navigation/src/views/StackView/StackViewLayout.js @@ -211,6 +211,8 @@ class StackViewLayout extends React.Component { _panResponder = PanResponder.create({ onPanResponderTerminate: () => { + const { navigation } = this.props.transitionProps; + const { index } = navigation.state; this._isResponding = false; this._reset(index, 0); this.props.onGestureCanceled && this.props.onGestureCanceled();