Spread TVViewProps into ViewProps instead of intersection

Reviewed By: yungsters

Differential Revision: D7976556

fbshipit-source-id: ca2f6bcac249a937523c4b50add8960085a8be49
This commit is contained in:
Eli White 2018-05-12 10:25:01 -07:00 committed by Facebook Github Bot
parent dbc9364b21
commit bc658d3c44
2 changed files with 7 additions and 5 deletions

View File

@ -71,7 +71,7 @@ const TVViewPropTypes = {
tvParallaxMagnification: PropTypes.number, tvParallaxMagnification: PropTypes.number,
}; };
export type TVViewProps = { export type TVViewProps = $ReadOnly<{|
isTVSelectable?: boolean, isTVSelectable?: boolean,
hasTVPreferredFocus?: boolean, hasTVPreferredFocus?: boolean,
tvParallaxProperties?: Object, tvParallaxProperties?: Object,
@ -79,6 +79,6 @@ export type TVViewProps = {
tvParallaxShiftDistanceY?: number, tvParallaxShiftDistanceY?: number,
tvParallaxTiltAngle?: number, tvParallaxTiltAngle?: number,
tvParallaxMagnification?: number, tvParallaxMagnification?: number,
}; |}>;
module.exports = TVViewPropTypes; module.exports = TVViewPropTypes;

View File

@ -35,9 +35,11 @@ const stylePropType = StyleSheetPropType(ViewStylePropTypes);
export type ViewLayout = Layout; export type ViewLayout = Layout;
export type ViewLayoutEvent = LayoutEvent; export type ViewLayoutEvent = LayoutEvent;
// There's no easy way to create a different type if (Platform.isTVOS):
// so we must include TVViewProps
export type ViewProps = { export type ViewProps = {
// There's no easy way to create a different type if (Platform.isTVOS):
// so we must include TVViewProps
...TVViewProps,
accessible?: boolean, accessible?: boolean,
accessibilityLabel?: accessibilityLabel?:
| null | null
@ -77,7 +79,7 @@ export type ViewProps = {
shouldRasterizeIOS?: boolean, shouldRasterizeIOS?: boolean,
collapsable?: boolean, collapsable?: boolean,
needsOffscreenAlphaCompositing?: boolean, needsOffscreenAlphaCompositing?: boolean,
} & TVViewProps; };
module.exports = { module.exports = {
/** /**