Expose useNativeAnimations for Drawer navigator (#2568)

* Expose useNativeAnimations for Drawer navigator

* Default useNativeAnimations to true
This commit is contained in:
Jonathan Kim 2017-09-12 09:03:37 -07:00 committed by Lorenzo Sciandra
parent fe4b1e2379
commit 23da6aebff
2 changed files with 5 additions and 0 deletions

View File

@ -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}

View File

@ -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'