mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-09 17:23:18 +08:00
feat: add custom GH props
This commit is contained in:
@@ -90,6 +90,7 @@ type Props = {
|
||||
contentContainerStyle?: ViewStyle;
|
||||
renderDrawerContent: Renderer;
|
||||
renderSceneContent: Renderer;
|
||||
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
|
||||
};
|
||||
|
||||
export default class DrawerView extends React.PureComponent<Props> {
|
||||
@@ -488,6 +489,7 @@ export default class DrawerView extends React.PureComponent<Props> {
|
||||
onGestureRef,
|
||||
renderDrawerContent,
|
||||
renderSceneContent,
|
||||
gestureHandlerProps,
|
||||
} = this.props;
|
||||
|
||||
const right = drawerPosition === 'right';
|
||||
@@ -519,6 +521,7 @@ export default class DrawerView extends React.PureComponent<Props> {
|
||||
onHandlerStateChange={this.handleGestureEvent}
|
||||
hitSlop={hitSlop}
|
||||
enabled={!locked}
|
||||
{...gestureHandlerProps}
|
||||
>
|
||||
<Animated.View
|
||||
onLayout={this.handleContainerLayout}
|
||||
|
||||
@@ -27,6 +27,7 @@ type DrawerOptions = {
|
||||
edgeWidth: number;
|
||||
hideStatusBar?: boolean;
|
||||
style?: ViewStyle;
|
||||
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
@@ -202,6 +203,7 @@ export default class DrawerView extends React.PureComponent<Props, State> {
|
||||
minSwipeDistance,
|
||||
hideStatusBar,
|
||||
statusBarAnimation,
|
||||
gestureHandlerProps,
|
||||
} = this.props.navigationConfig;
|
||||
const activeKey = navigation.state.routes[navigation.state.index].key;
|
||||
const { drawerLockMode } = this.props.descriptors[activeKey].options;
|
||||
@@ -224,6 +226,7 @@ export default class DrawerView extends React.PureComponent<Props, State> {
|
||||
onOpen={this.handleDrawerOpen}
|
||||
onClose={this.handleDrawerClose}
|
||||
onGestureRef={this.setDrawerGestureRef}
|
||||
gestureHandlerProps={gestureHandlerProps}
|
||||
drawerType={drawerType}
|
||||
drawerPosition={this.props.navigationConfig.drawerPosition}
|
||||
contentContainerStyle={contentContainerStyle}
|
||||
|
||||
Reference in New Issue
Block a user