@@ -21,25 +21,24 @@ const View = require('View');
21
21
type Context = {
22
22
rootTag : number ,
23
23
} ;
24
- type Props = { |
25
- /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
26
- * suppresses an error when upgrading Flow's support for React. To see the
27
- * error delete this comment and run Flow. */
28
- children ? : React . Children ,
24
+
25
+ type Props = $ReadOnly < { |
26
+ children ?: React . Node ,
29
27
rootTag : number ,
30
- WrapperComponent ?: ?React . ComponentType < * > ,
31
- | } ;
32
- type State = {
33
- inspector : ?React . Element < any > ,
28
+ WrapperComponent ?: ?React . ComponentType < any > ,
29
+ | } > ;
30
+
31
+ type State = { |
32
+ inspector : ?React . Node ,
34
33
mainKey : number ,
35
- } ;
34
+ | } ;
36
35
37
36
class AppContainer extends React . Component < Props , State > {
38
37
state : State = {
39
38
inspector : null ,
40
39
mainKey : 1 ,
41
40
} ;
42
- _mainRef : ?React . Element < any > ;
41
+ _mainRef : ?React . ElementRef < typeof View > ;
43
42
_subscription : ?EmitterSubscription = null ;
44
43
45
44
static childContextTypes = {
@@ -81,7 +80,7 @@ class AppContainer extends React.Component<Props, State> {
81
80
}
82
81
83
82
componentWillUnmount ( ) : void {
84
- if ( this . _subscription ) {
83
+ if ( this . _subscription != null ) {
85
84
this . _subscription . remove ( ) ;
86
85
}
87
86
}
@@ -102,15 +101,14 @@ class AppContainer extends React.Component<Props, State> {
102
101
pointerEvents = "box-none"
103
102
style = { styles . appContainer }
104
103
ref = { ref => {
105
- // $FlowFixMe - Typing ReactNativeComponent revealed errors
106
104
this . _mainRef = ref ;
107
105
} } >
108
106
{ this . props . children }
109
107
</ View >
110
108
) ;
111
109
112
110
const Wrapper = this . props . WrapperComponent ;
113
- if ( Wrapper ) {
111
+ if ( Wrapper != null ) {
114
112
innerView = < Wrapper > { innerView } </ Wrapper > ;
115
113
}
116
114
return (
0 commit comments