Making values optional in ViewPropTypes
Reviewed By: yungsters Differential Revision: D7209560 fbshipit-source-id: fd0c55c4f69648927380d12ad9a6b9bcb98047eb
This commit is contained in:
parent
2520c645f8
commit
f1316cab6c
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
const React = require('React');
|
||||
const EdgeInsetsPropType = require('EdgeInsetsPropType');
|
||||
const PlatformViewPropTypes = require('PlatformViewPropTypes');
|
||||
const PropTypes = require('prop-types');
|
||||
|
@ -26,21 +27,12 @@ import type {
|
|||
} from 'ViewAccessibility';
|
||||
import type {EdgeInsetsProp} from 'EdgeInsetsPropType';
|
||||
import type {TVViewProps} from 'TVViewPropTypes';
|
||||
import type {Layout, LayoutEvent} from 'CoreEventTypes';
|
||||
|
||||
const stylePropType = StyleSheetPropType(ViewStylePropTypes);
|
||||
|
||||
export type ViewLayout = {
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
}
|
||||
|
||||
export type ViewLayoutEvent = {
|
||||
nativeEvent: {
|
||||
layout: ViewLayout,
|
||||
}
|
||||
}
|
||||
export type ViewLayout = Layout;
|
||||
export type ViewLayoutEvent = LayoutEvent;
|
||||
|
||||
// There's no easy way to create a different type if (Platform.isTVOS):
|
||||
// so we must include TVViewProps
|
||||
|
@ -54,23 +46,24 @@ export type ViewProps = {
|
|||
accessibilityTraits?: AccessibilityTrait | Array<AccessibilityTrait>,
|
||||
accessibilityViewIsModal?: bool,
|
||||
accessibilityElementsHidden?: bool,
|
||||
children?: ?React.Node,
|
||||
onAccessibilityAction?: Function,
|
||||
onAccessibilityTap?: Function,
|
||||
onMagicTap?: Function,
|
||||
testID?: string,
|
||||
testID?: ?string,
|
||||
nativeID?: string,
|
||||
onLayout?: (event: ViewLayoutEvent) => void,
|
||||
onResponderGrant?: Function,
|
||||
onResponderMove?: Function,
|
||||
onResponderReject?: Function,
|
||||
onResponderRelease?: Function,
|
||||
onResponderTerminate?: Function,
|
||||
onResponderTerminationRequest?: Function,
|
||||
onStartShouldSetResponder?: Function,
|
||||
onStartShouldSetResponderCapture?: Function,
|
||||
onMoveShouldSetResponder?: Function,
|
||||
onMoveShouldSetResponderCapture?: Function,
|
||||
hitSlop?: EdgeInsetsProp,
|
||||
onLayout?: ?(event: LayoutEvent) => void,
|
||||
onResponderGrant?: ?Function,
|
||||
onResponderMove?: ?Function,
|
||||
onResponderReject?: ?Function,
|
||||
onResponderRelease?: ?Function,
|
||||
onResponderTerminate?: ?Function,
|
||||
onResponderTerminationRequest?: ?Function,
|
||||
onStartShouldSetResponder?: ?Function,
|
||||
onStartShouldSetResponderCapture?: ?Function,
|
||||
onMoveShouldSetResponder?: ?Function,
|
||||
onMoveShouldSetResponderCapture?: ?Function,
|
||||
hitSlop?: ?EdgeInsetsProp,
|
||||
pointerEvents?: null | 'box-none'| 'none'| 'box-only'| 'auto',
|
||||
style?: stylePropType,
|
||||
removeClippedSubviews?: bool,
|
||||
|
|
Loading…
Reference in New Issue