RN: Nullable Image, Text, & View Props

Summary:
Changes the Flow prop types for `Image`, `Text`, and `View` to be nullable and optional.

This makes these components easier to compose.

Reviewed By: sahrens

Differential Revision: D9494285

fbshipit-source-id: c3f17147f063b31217b239a3abc085d1850f8df9
This commit is contained in:
Tim Yung
2018-08-24 10:38:42 -07:00
committed by Facebook Github Bot
parent 8dc209a523
commit 47dc31d464
4 changed files with 50 additions and 51 deletions

View File

@@ -54,7 +54,7 @@ export type ImageProps = {|
...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>,
...IOSImageProps,
...AndroidImageProps,
blurRadius?: number,
blurRadius?: ?number,
capInsets?: ?EdgeInsetsProp,
onError?: ?(event: SyntheticEvent<$ReadOnly<{||}>>) => void,
@@ -63,11 +63,11 @@ export type ImageProps = {|
onLoadStart?: ?() => void,
resizeMethod?: ?('auto' | 'resize' | 'scale'),
source?: ?ImageSource,
style?: ImageStyleProp,
style?: ?ImageStyleProp,
// Can be set via props or style, for now
height?: DimensionValue,
width?: DimensionValue,
height?: ?DimensionValue,
width?: ?DimensionValue,
resizeMode?: ?('cover' | 'contain' | 'stretch' | 'repeat' | 'center'),
src?: empty,