Skip to content

Commit

Permalink
Spread TVViewProps into ViewProps instead of intersection
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7976556

fbshipit-source-id: ca2f6bcac249a937523c4b50add8960085a8be49
  • Loading branch information
elicwhite authored and facebook-github-bot committed May 12, 2018
1 parent dbc9364 commit bc658d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Libraries/Components/AppleTV/TVViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ const TVViewPropTypes = {
tvParallaxMagnification: PropTypes.number,
};

export type TVViewProps = {
export type TVViewProps = $ReadOnly<{|
isTVSelectable?: boolean,
hasTVPreferredFocus?: boolean,
tvParallaxProperties?: Object,
tvParallaxShiftDistanceX?: number,
tvParallaxShiftDistanceY?: number,
tvParallaxTiltAngle?: number,
tvParallaxMagnification?: number,
};
|}>;

module.exports = TVViewPropTypes;
8 changes: 5 additions & 3 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,7 +79,7 @@ export type ViewProps = {
shouldRasterizeIOS?: boolean,
collapsable?: boolean,
needsOffscreenAlphaCompositing?: boolean,
} & TVViewProps;
};

module.exports = {
/**
Expand Down

0 comments on commit bc658d3

Please sign in to comment.