File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface StyleSheetProperties {
14
14
flatten < T extends string > ( style : T ) : T ;
15
15
}
16
16
17
- type Falsy = undefined | null | false ;
17
+ type Falsy = undefined | null | false | '' ;
18
18
interface RecursiveArray < T >
19
19
extends Array < T | ReadonlyArray < T > | RecursiveArray < T > > { }
20
20
/** Keep a brand of 'T' so that calls to `StyleSheet.flatten` can take `RegisteredStyle<T>` and return `T`. */
Original file line number Diff line number Diff line change @@ -411,7 +411,9 @@ class CustomView extends React.Component {
411
411
}
412
412
}
413
413
414
- class Welcome extends React . Component < ElementProps < View > & { color : string } > {
414
+ class Welcome extends React . Component <
415
+ ElementProps < View > & { color : string ; bgColor ?: null | undefined | string }
416
+ > {
415
417
rootViewRef = React . useRef < View > ( null ) ;
416
418
customViewRef = React . useRef < CustomView > ( null ) ;
417
419
@@ -436,12 +438,18 @@ class Welcome extends React.Component<ElementProps<View> & {color: string}> {
436
438
}
437
439
438
440
render ( ) {
439
- const { color, ...props } = this . props ;
441
+ const { color, bgColor , ...props } = this . props ;
440
442
return (
441
443
< View
442
444
{ ...props }
443
445
ref = { this . rootViewRef }
444
- style = { [ [ styles . container ] , undefined , null , false ] } >
446
+ style = { [
447
+ [ styles . container ] ,
448
+ undefined ,
449
+ null ,
450
+ false ,
451
+ bgColor && { backgroundColor : bgColor } ,
452
+ ] } >
445
453
< Text style = { styles . welcome } > Welcome to React Native</ Text >
446
454
< Text style = { styles . instructions } >
447
455
To get started, edit index.ios.js
You can’t perform that action at this time.
0 commit comments