mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 04:45:19 +08:00
Expose useNativeAnimations for Drawer navigator (#2568)
* Expose useNativeAnimations for Drawer navigator * Default useNativeAnimations to true
This commit is contained in:
committed by
Lorenzo Sciandra
parent
fe4b1e2379
commit
23da6aebff
@@ -32,6 +32,7 @@ const DefaultDrawerConfig = {
|
|||||||
Dimensions.get('window').width - (Platform.OS === 'android' ? 56 : 64),
|
Dimensions.get('window').width - (Platform.OS === 'android' ? 56 : 64),
|
||||||
contentComponent: DrawerItems,
|
contentComponent: DrawerItems,
|
||||||
drawerPosition: 'left',
|
drawerPosition: 'left',
|
||||||
|
useNativeAnimations: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const DrawerNavigator = (
|
const DrawerNavigator = (
|
||||||
@@ -45,6 +46,7 @@ const DrawerNavigator = (
|
|||||||
contentComponent,
|
contentComponent,
|
||||||
contentOptions,
|
contentOptions,
|
||||||
drawerPosition,
|
drawerPosition,
|
||||||
|
useNativeAnimations,
|
||||||
...tabsConfig
|
...tabsConfig
|
||||||
} = mergedConfig;
|
} = mergedConfig;
|
||||||
|
|
||||||
@@ -80,6 +82,7 @@ const DrawerNavigator = (
|
|||||||
)((props: *) =>
|
)((props: *) =>
|
||||||
<DrawerView
|
<DrawerView
|
||||||
{...props}
|
{...props}
|
||||||
|
useNativeAnimations={useNativeAnimations}
|
||||||
drawerWidth={drawerWidth}
|
drawerWidth={drawerWidth}
|
||||||
contentComponent={contentComponent}
|
contentComponent={contentComponent}
|
||||||
contentOptions={contentOptions}
|
contentOptions={contentOptions}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export type DrawerViewConfig = {
|
|||||||
contentComponent: ReactClass<*>,
|
contentComponent: ReactClass<*>,
|
||||||
contentOptions?: {},
|
contentOptions?: {},
|
||||||
style?: ViewStyleProp,
|
style?: ViewStyleProp,
|
||||||
|
useNativeAnimations: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
type Props = DrawerViewConfig & {
|
type Props = DrawerViewConfig & {
|
||||||
@@ -145,6 +146,7 @@ export default class DrawerView<T: *> extends PureComponent<void, Props, void> {
|
|||||||
drawerWidth={this.props.drawerWidth}
|
drawerWidth={this.props.drawerWidth}
|
||||||
onDrawerOpen={this._handleDrawerOpen}
|
onDrawerOpen={this._handleDrawerOpen}
|
||||||
onDrawerClose={this._handleDrawerClose}
|
onDrawerClose={this._handleDrawerClose}
|
||||||
|
useNativeAnimations={this.props.useNativeAnimations}
|
||||||
renderNavigationView={this._renderNavigationView}
|
renderNavigationView={this._renderNavigationView}
|
||||||
drawerPosition={
|
drawerPosition={
|
||||||
this.props.drawerPosition === 'right'
|
this.props.drawerPosition === 'right'
|
||||||
|
|||||||
Reference in New Issue
Block a user