Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 7875b72

Browse files
osdnksatya164
authored andcommitted
feat: add custom GH props
1 parent 8210c5e commit 7875b72

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/views/Drawer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ type Props = {
9090
contentContainerStyle?: ViewStyle;
9191
renderDrawerContent: Renderer;
9292
renderSceneContent: Renderer;
93+
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
9394
};
9495

9596
export default class DrawerView extends React.PureComponent<Props> {
@@ -488,6 +489,7 @@ export default class DrawerView extends React.PureComponent<Props> {
488489
onGestureRef,
489490
renderDrawerContent,
490491
renderSceneContent,
492+
gestureHandlerProps,
491493
} = this.props;
492494

493495
const right = drawerPosition === 'right';
@@ -519,6 +521,7 @@ export default class DrawerView extends React.PureComponent<Props> {
519521
onHandlerStateChange={this.handleGestureEvent}
520522
hitSlop={hitSlop}
521523
enabled={!locked}
524+
{...gestureHandlerProps}
522525
>
523526
<Animated.View
524527
onLayout={this.handleContainerLayout}

src/views/DrawerView.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type DrawerOptions = {
2727
edgeWidth: number;
2828
hideStatusBar?: boolean;
2929
style?: ViewStyle;
30+
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
3031
};
3132

3233
type Props = {
@@ -202,6 +203,7 @@ export default class DrawerView extends React.PureComponent<Props, State> {
202203
minSwipeDistance,
203204
hideStatusBar,
204205
statusBarAnimation,
206+
gestureHandlerProps,
205207
} = this.props.navigationConfig;
206208
const activeKey = navigation.state.routes[navigation.state.index].key;
207209
const { drawerLockMode } = this.props.descriptors[activeKey].options;
@@ -224,6 +226,7 @@ export default class DrawerView extends React.PureComponent<Props, State> {
224226
onOpen={this.handleDrawerOpen}
225227
onClose={this.handleDrawerClose}
226228
onGestureRef={this.setDrawerGestureRef}
229+
gestureHandlerProps={gestureHandlerProps}
227230
drawerType={drawerType}
228231
drawerPosition={this.props.navigationConfig.drawerPosition}
229232
contentContainerStyle={contentContainerStyle}

0 commit comments

Comments
 (0)