Disable / enable swipe depending on screen. (#2906)

* Disable / enable swipe depending on screen.

react-community#1760

* Updated to master

* Revert "Updated to master"

This reverts commit a3aede19588cdbc7fc9148d148260f51d6316e6f.

* - Fixed CircleCI errors

* - Fixed CircleCI errors
This commit is contained in:
Sergei
2017-12-02 01:53:26 +04:00
parent 27dcb5b5d0
commit bffb9d17ff
2 changed files with 9 additions and 1 deletions

View File

@@ -168,6 +168,10 @@ Generic title that can be used as a fallback for `headerTitle` and `tabBarLabel`
True or false to show or hide the tab bar, if not set then defaults to true.
#### `swipeEnabled`
True or false to enable or disable swiping between tabs, if not set then defaults to TabNavigatorConfig option swipeEnabled.
#### `tabBarIcon`
React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Node, to display in tab bar.

View File

@@ -171,7 +171,6 @@ class TabView extends React.PureComponent<Props> {
tabBarPosition,
animationEnabled,
configureTransition,
swipeEnabled,
lazy,
initialLayout,
screenProps,
@@ -190,6 +189,11 @@ class TabView extends React.PureComponent<Props> {
const tabBarVisible =
options.tabBarVisible == null ? true : options.tabBarVisible;
const swipeEnabled =
options.swipeEnabled == null
? this.props.swipeEnabled
: options.swipeEnabled;
if (tabBarComponent !== undefined && tabBarVisible) {
if (tabBarPosition === 'bottom') {
renderFooter = this._renderTabBar;