mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Typing View style as ViewStyleProp
Summary: Locking down view style so that invalid styles can't be passed into View. Reviewed By: yungsters Differential Revision: D9309097 fbshipit-source-id: 69e7e3c5626609cfd47c167027a55470c42228c8
This commit is contained in:
committed by
Facebook Github Bot
parent
22cf5dc566
commit
76948ad1bd
@@ -483,7 +483,6 @@ export type Props = $ReadOnly<{|
|
||||
* See [RefreshControl](docs/refreshcontrol.html).
|
||||
*/
|
||||
refreshControl?: ?React.Element<any>,
|
||||
style?: ?ViewStyleProp,
|
||||
children?: React.Node,
|
||||
|}>;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ const requireNativeComponent = require('requireNativeComponent');
|
||||
const warning = require('fbjs/lib/warning');
|
||||
|
||||
import type {ColorValue} from 'StyleSheetTypes';
|
||||
import type {TextStyleProp} from 'StyleSheet';
|
||||
import type {TextStyleProp, ViewStyleProp} from 'StyleSheet';
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
let AndroidTextInput;
|
||||
@@ -169,7 +169,7 @@ type AndroidProps = $ReadOnly<{|
|
||||
|}>;
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>,
|
||||
...IOSProps,
|
||||
...AndroidProps,
|
||||
autoCapitalize?: ?AutoCapitalize,
|
||||
|
||||
@@ -33,6 +33,7 @@ import type {
|
||||
import type {EdgeInsetsProp} from 'EdgeInsetsPropType';
|
||||
import type {TVViewProps} from 'TVViewPropTypes';
|
||||
import type {Layout, LayoutEvent} from 'CoreEventTypes';
|
||||
import type {ViewStyleProp} from 'StyleSheet';
|
||||
|
||||
const stylePropType = StyleSheetPropType(ViewStylePropTypes);
|
||||
|
||||
@@ -103,7 +104,7 @@ export type ViewProps = $ReadOnly<{|
|
||||
nativeID?: string,
|
||||
hitSlop?: ?EdgeInsetsProp,
|
||||
pointerEvents?: null | 'box-none' | 'none' | 'box-only' | 'auto',
|
||||
style?: stylePropType,
|
||||
style?: ?ViewStyleProp,
|
||||
removeClippedSubviews?: boolean,
|
||||
renderToHardwareTextureAndroid?: boolean,
|
||||
shouldRasterizeIOS?: boolean,
|
||||
|
||||
Reference in New Issue
Block a user