Skip to content

Instantly share code, notes, and snippets.

@Ashoat
Created February 19, 2017 00:44
Show Gist options
  • Save Ashoat/54a4b0efd8ef1a2ea040dfcd1579819d to your computer and use it in GitHub Desktop.
Save Ashoat/54a4b0efd8ef1a2ea040dfcd1579819d to your computer and use it in GitHub Desktop.
ashoat@Ashoats-MacBook-Pro [~/Dropbox/src/react-navigation]# git diff
diff --git a/docs/api/navigators/StackNavigator.md b/docs/api/navigators/StackNavigator.md
index 3816577..f8895eb 100644
--- a/docs/api/navigators/StackNavigator.md
+++ b/docs/api/navigators/StackNavigator.md
@@ -87,6 +87,7 @@ Visual options:
- `cardStyle` - Use this prop to override or extend the default style for an individual card in stack.
- `onTransitionStart` - Function to be invoked when the card transition animation is about to start.
- `onTransitionEnd` - Function to be invoked once the card transition animation completes.
+- `gesturesEnabled` - Whether routes on the stack can be popped through gestures. Defaults to true on iOS, false on Android
### Screen Navigation Options
diff --git a/src/TypeDefinition.js b/src/TypeDefinition.js
index e616c3f..0a734fc 100644
--- a/src/TypeDefinition.js
+++ b/src/TypeDefinition.js
@@ -263,7 +263,8 @@ export type NavigationStackViewConfig = {
headerComponent?: ReactClass<HeaderProps<*>>,
cardStyle?: Style,
onTransitionStart?: () => void,
- onTransitionEnd?: () => void
+ onTransitionEnd?: () => void,
+ gesturesEnabled?: bool,
};
export type NavigationStackRouterConfig = {
diff --git a/src/navigators/StackNavigator.js b/src/navigators/StackNavigator.js
index 0b9b702..c78c9f2 100644
--- a/src/navigators/StackNavigator.js
+++ b/src/navigators/StackNavigator.js
@@ -31,6 +31,7 @@ export default (routeConfigMap: NavigationRouteConfigMap, stackConfig: StackNavi
onTransitionStart,
onTransitionEnd,
navigationOptions,
+ gesturesEnabled,
} = stackConfig;
const stackRouterConfig = {
initialRouteName,
@@ -48,6 +49,7 @@ export default (routeConfigMap: NavigationRouteConfigMap, stackConfig: StackNavi
cardStyle={cardStyle}
onTransitionStart={onTransitionStart}
onTransitionEnd={onTransitionEnd}
+ gesturesEnabled={gesturesEnabled}
/>
)), containerOptions);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment