Make ViewProps Exact
Reviewed By: yungsters Differential Revision: D7976755 fbshipit-source-id: f6a0da1023a9235763c7ecb3ca7a9238887d0471
This commit is contained in:
parent
bc658d3c44
commit
65c336f38f
|
@ -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
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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,
|
||||
|
@ -79,7 +79,7 @@ export type ViewProps = {
|
|||
shouldRasterizeIOS?: boolean,
|
||||
collapsable?: boolean,
|
||||
needsOffscreenAlphaCompositing?: boolean,
|
||||
};
|
||||
|}>;
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue