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 коммит произвёл Facebook Github Bot
Родитель dbc9364b21
Коммит bc658d3c44
2 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 = {
/**