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