Skip to content

Commit 41a9403

Browse files
yungstersfacebook-github-bot
authored andcommittedMay 13, 2018
RN: Add Missing Events to ViewPropTypes
Reviewed By: TheSavior Differential Revision: D7984937 fbshipit-source-id: fc2703e3382a7515b71f8a634aca5b6d7a5b25b4
1 parent 3d3edfc commit 41a9403

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed
 

‎Libraries/Components/View/ViewPropTypes.js

+36-14
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,43 @@ const stylePropType = StyleSheetPropType(ViewStylePropTypes);
3535
export type ViewLayout = Layout;
3636
export type ViewLayoutEvent = LayoutEvent;
3737

38+
type DirectEventProps = $ReadOnly<{|
39+
onAccessibilityAction?: Function,
40+
onAccessibilityTap?: Function,
41+
onLayout?: ?(event: LayoutEvent) => void,
42+
onMagicTap?: Function,
43+
|}>;
44+
45+
type TouchEventProps = $ReadOnly<{|
46+
onTouchCancel?: ?Function,
47+
onTouchCancelCapture?: ?Function,
48+
onTouchEnd?: ?Function,
49+
onTouchEndCapture?: ?Function,
50+
onTouchMove?: ?Function,
51+
onTouchMoveCapture?: ?Function,
52+
onTouchStart?: ?Function,
53+
onTouchStartCapture?: ?Function,
54+
|}>;
55+
56+
type GestureResponderEventProps = $ReadOnly<{|
57+
onMoveShouldSetResponder?: ?Function,
58+
onMoveShouldSetResponderCapture?: ?Function,
59+
onResponderGrant?: ?Function,
60+
onResponderMove?: ?Function,
61+
onResponderReject?: ?Function,
62+
onResponderRelease?: ?Function,
63+
onResponderStart?: ?Function,
64+
onResponderTerminate?: ?Function,
65+
onResponderTerminationRequest?: ?Function,
66+
onStartShouldSetResponder?: ?Function,
67+
onStartShouldSetResponderCapture?: ?Function,
68+
|}>;
69+
3870
export type ViewProps = $ReadOnly<{|
71+
...DirectEventProps,
72+
...GestureResponderEventProps,
73+
...TouchEventProps,
74+
3975
// There's no easy way to create a different type if (Platform.isTVOS):
4076
// so we must include TVViewProps
4177
...TVViewProps,
@@ -55,22 +91,8 @@ export type ViewProps = $ReadOnly<{|
5591
accessibilityViewIsModal?: boolean,
5692
accessibilityElementsHidden?: boolean,
5793
children?: ?React.Node,
58-
onAccessibilityAction?: Function,
59-
onAccessibilityTap?: Function,
60-
onMagicTap?: Function,
6194
testID?: ?string,
6295
nativeID?: string,
63-
onLayout?: ?(event: LayoutEvent) => void,
64-
onResponderGrant?: ?Function,
65-
onResponderMove?: ?Function,
66-
onResponderReject?: ?Function,
67-
onResponderRelease?: ?Function,
68-
onResponderTerminate?: ?Function,
69-
onResponderTerminationRequest?: ?Function,
70-
onStartShouldSetResponder?: ?Function,
71-
onStartShouldSetResponderCapture?: ?Function,
72-
onMoveShouldSetResponder?: ?Function,
73-
onMoveShouldSetResponderCapture?: ?Function,
7496
hitSlop?: ?EdgeInsetsProp,
7597
pointerEvents?: null | 'box-none' | 'none' | 'box-only' | 'auto',
7698
style?: stylePropType,

0 commit comments

Comments
 (0)