Skip to content

Commit

Permalink
Make ViewProps Exact
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7976755

fbshipit-source-id: f6a0da1023a9235763c7ecb3ca7a9238887d0471
  • Loading branch information
TheSavior authored and facebook-github-bot committed May 12, 2018
1 parent bc658d3 commit 65c336f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Libraries/Components/MaskedView/MaskedViewIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const requireNativeComponent = require('requireNativeComponent');

import type {ViewProps} from 'ViewPropTypes';

type Props = ViewProps & {
type Props = {
...ViewProps,

children: any,
/**
* Should be a React element to be rendered and applied as the
Expand Down
27 changes: 14 additions & 13 deletions Libraries/Components/TabBarIOS/TabBarIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ const requireNativeComponent = require('requireNativeComponent');
import type {DangerouslyImpreciseStyleProp} from 'StyleSheet';
import type {ViewProps} from 'ViewPropTypes';

class TabBarIOS extends React.Component<
ViewProps & {
style?: DangerouslyImpreciseStyleProp,
unselectedTintColor?: string,
tintColor?: string,
unselectedItemTintColor?: string,
barTintColor?: string,
barStyle?: 'default' | 'black',
translucent?: boolean,
itemPositioning?: 'fill' | 'center' | 'auto',
children: React.Node,
},
> {
type Props = $ReadOnly<{|
...ViewProps,
style?: DangerouslyImpreciseStyleProp,
unselectedTintColor?: string,
tintColor?: string,
unselectedItemTintColor?: string,
barTintColor?: string,
barStyle?: 'default' | 'black',
translucent?: boolean,
itemPositioning?: 'fill' | 'center' | 'auto',
children: React.Node,
|}>;

class TabBarIOS extends React.Component<Props> {
static Item = TabBarItemIOS;

static propTypes = {
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const stylePropType = StyleSheetPropType(ViewStylePropTypes);
export type ViewLayout = Layout;
export type ViewLayoutEvent = LayoutEvent;

export type ViewProps = {
export type ViewProps = $ReadOnly<{|
// There's no easy way to create a different type if (Platform.isTVOS):
// so we must include TVViewProps
...TVViewProps,
Expand Down Expand Up @@ -79,7 +79,7 @@ export type ViewProps = {
shouldRasterizeIOS?: boolean,
collapsable?: boolean,
needsOffscreenAlphaCompositing?: boolean,
};
|}>;

module.exports = {
/**
Expand Down

0 comments on commit 65c336f

Please sign in to comment.