mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-12 09:21:09 +08:00
Upgrade react-native-tab-view (#3064)
This commit is contained in:
@@ -88,7 +88,6 @@ The route configs object is a mapping from route name to a route config, which t
|
||||
- `swipeEnabled` - Whether to allow swiping between tabs.
|
||||
- `animationEnabled` - Whether to animate when changing tabs.
|
||||
- `configureTransition` - a function that, given `currentTransitionProps` and `nextTransitionProps`, returns a configuration object that describes the animation between tabs.
|
||||
- `lazy` - Whether to lazily render tabs as needed as opposed to rendering them upfront.
|
||||
- `initialLayout` - Optional object containing the initial `height` and `width`, can be passed to prevent the one frame delay in [react-native-tab-view](https://github.com/react-native-community/react-native-tab-view#avoid-one-frame-delay) rendering.
|
||||
- `tabBarOptions` - Configure the tab bar, see below.
|
||||
|
||||
|
||||
@@ -4617,11 +4617,11 @@ react-native-scripts@^1.5.0:
|
||||
color "^2.0.1"
|
||||
lodash "^4.16.6"
|
||||
|
||||
react-native-tab-view@^0.0.70:
|
||||
version "0.0.70"
|
||||
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.70.tgz#1dd2ded32acd0cb6bfef38d26e53675db733b37b"
|
||||
react-native-tab-view@^0.0.74:
|
||||
version "0.0.74"
|
||||
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.74.tgz#62c0c882d9232b461ce181d440d683b4f99d1bd8"
|
||||
dependencies:
|
||||
prop-types "^15.5.10"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react-native-vector-icons@4.4.2:
|
||||
version "4.4.2"
|
||||
@@ -4698,7 +4698,7 @@ react-native@^0.51.0:
|
||||
path-to-regexp "^1.7.0"
|
||||
prop-types "^15.5.10"
|
||||
react-native-drawer-layout-polyfill "^1.3.2"
|
||||
react-native-tab-view "^0.0.70"
|
||||
react-native-tab-view "^0.0.74"
|
||||
|
||||
react-proxy@^1.1.7:
|
||||
version "1.1.8"
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"react-native-drawer-layout-polyfill": "^1.3.2",
|
||||
"react-native-tab-view": "^0.0.70"
|
||||
"react-native-tab-view": "^0.0.74"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.24.1",
|
||||
|
||||
@@ -49,7 +49,6 @@ const TabNavigator = (
|
||||
swipeEnabled,
|
||||
animationEnabled,
|
||||
configureTransition,
|
||||
lazy,
|
||||
initialLayout,
|
||||
...tabsConfig
|
||||
} = mergedConfig;
|
||||
@@ -70,7 +69,6 @@ const TabNavigator = (
|
||||
swipeEnabled={swipeEnabled}
|
||||
animationEnabled={animationEnabled}
|
||||
configureTransition={configureTransition}
|
||||
lazy={lazy}
|
||||
initialLayout={initialLayout}
|
||||
/>
|
||||
));
|
||||
@@ -84,7 +82,6 @@ const Presets = {
|
||||
tabBarPosition: 'bottom',
|
||||
swipeEnabled: false,
|
||||
animationEnabled: false,
|
||||
lazy: false,
|
||||
initialLayout: undefined,
|
||||
},
|
||||
AndroidTopTabs: {
|
||||
@@ -92,7 +89,6 @@ const Presets = {
|
||||
tabBarPosition: 'top',
|
||||
swipeEnabled: true,
|
||||
animationEnabled: true,
|
||||
lazy: false,
|
||||
initialLayout: undefined,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -26,7 +26,6 @@ export type TabViewConfig = {
|
||||
currentTransitionProps: Object,
|
||||
nextTransitionProps: Object
|
||||
) => Object,
|
||||
lazy?: boolean,
|
||||
initialLayout?: Layout,
|
||||
};
|
||||
|
||||
@@ -47,7 +46,6 @@ type Props = {
|
||||
currentTransitionProps: Object,
|
||||
nextTransitionProps: Object
|
||||
) => Object,
|
||||
lazy?: boolean,
|
||||
initialLayout: Layout,
|
||||
|
||||
screenProps?: {},
|
||||
@@ -171,7 +169,6 @@ class TabView extends React.PureComponent<Props> {
|
||||
tabBarPosition,
|
||||
animationEnabled,
|
||||
configureTransition,
|
||||
lazy,
|
||||
initialLayout,
|
||||
screenProps,
|
||||
} = this.props;
|
||||
@@ -210,7 +207,6 @@ class TabView extends React.PureComponent<Props> {
|
||||
}
|
||||
|
||||
const props = {
|
||||
lazy,
|
||||
initialLayout,
|
||||
animationEnabled,
|
||||
configureTransition,
|
||||
@@ -225,7 +221,6 @@ class TabView extends React.PureComponent<Props> {
|
||||
style: styles.container,
|
||||
};
|
||||
|
||||
// $FlowFixMe: mismatch with react-native-tab-view type
|
||||
return <TabViewAnimated {...props} />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ exports[`TabBarBottom renders successfully 1`] = `
|
||||
bounces={false}
|
||||
contentContainerStyle={
|
||||
Object {
|
||||
"flexGrow": 1,
|
||||
"flex": 1,
|
||||
}
|
||||
}
|
||||
contentOffset={
|
||||
@@ -164,9 +164,10 @@ exports[`TabBarBottom renders successfully 1`] = `
|
||||
onTouchEnd={[Function]}
|
||||
onTouchMove={[Function]}
|
||||
onTouchStart={[Function]}
|
||||
overScrollMode="never"
|
||||
pagingEnabled={true}
|
||||
scrollEnabled={undefined}
|
||||
scrollEventThrottle={16}
|
||||
scrollEventThrottle={1}
|
||||
scrollsToTop={false}
|
||||
sendMomentumEvents={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
@@ -179,7 +180,7 @@ exports[`TabBarBottom renders successfully 1`] = `
|
||||
"overflow": "scroll",
|
||||
},
|
||||
Object {
|
||||
"flexGrow": 1,
|
||||
"flex": 1,
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -193,7 +194,7 @@ exports[`TabBarBottom renders successfully 1`] = `
|
||||
"flexDirection": "row",
|
||||
},
|
||||
Object {
|
||||
"flexGrow": 1,
|
||||
"flex": 1,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -4488,11 +4488,11 @@ react-native-drawer-layout@1.3.2:
|
||||
dependencies:
|
||||
react-native-dismiss-keyboard "1.0.0"
|
||||
|
||||
react-native-tab-view@^0.0.70:
|
||||
version "0.0.70"
|
||||
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.70.tgz#1dd2ded32acd0cb6bfef38d26e53675db733b37b"
|
||||
react-native-tab-view@^0.0.74:
|
||||
version "0.0.74"
|
||||
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.74.tgz#62c0c882d9232b461ce181d440d683b4f99d1bd8"
|
||||
dependencies:
|
||||
prop-types "^15.5.10"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react-native-vector-icons@^4.2.0:
|
||||
version "4.4.2"
|
||||
|
||||
Reference in New Issue
Block a user