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

View File

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