Skip to content

Commit

Permalink
Making values optional in ViewPropTypes
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7209560

fbshipit-source-id: fd0c55c4f69648927380d12ad9a6b9bcb98047eb
  • Loading branch information
elicwhite authored and facebook-github-bot committed Mar 9, 2018
1 parent 2520c64 commit f1316ca
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
'use strict';

const React = require('React');
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const PlatformViewPropTypes = require('PlatformViewPropTypes');
const PropTypes = require('prop-types');
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit f1316ca

Please sign in to comment.