Permalink
Browse files

Making values optional in ViewPropTypes

Reviewed By: yungsters

Differential Revision: D7209560

fbshipit-source-id: fd0c55c4f69648927380d12ad9a6b9bcb98047eb
  • Loading branch information...
TheSavior authored and facebook-github-bot committed Mar 9, 2018
1 parent 2520c64 commit f1316cab6c351852ef1da9939d4c8f0244fb8a6f
Showing with 18 additions and 25 deletions.
  1. +18 −25 Libraries/Components/View/ViewPropTypes.js
@@ -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,

0 comments on commit f1316ca

Please sign in to comment.