Skip to content

Commit a956551

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Fix $FlowFixMe in AppContainer
Summary: Fixes the `$FlowFixMe` type errors in `AppContainer`. Reviewed By: TheSavior Differential Revision: D7987552 fbshipit-source-id: 5eba319aa2661c2d6d8ed24affc066504096b72c
1 parent 206ef54 commit a956551

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

Diff for: Libraries/ReactNative/AppContainer.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,24 @@ const View = require('View');
2121
type Context = {
2222
rootTag: number,
2323
};
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,
2927
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,
3433
mainKey: number,
35-
};
34+
|};
3635

3736
class AppContainer extends React.Component<Props, State> {
3837
state: State = {
3938
inspector: null,
4039
mainKey: 1,
4140
};
42-
_mainRef: ?React.Element<any>;
41+
_mainRef: ?React.ElementRef<typeof View>;
4342
_subscription: ?EmitterSubscription = null;
4443

4544
static childContextTypes = {
@@ -81,7 +80,7 @@ class AppContainer extends React.Component<Props, State> {
8180
}
8281

8382
componentWillUnmount(): void {
84-
if (this._subscription) {
83+
if (this._subscription != null) {
8584
this._subscription.remove();
8685
}
8786
}
@@ -102,15 +101,14 @@ class AppContainer extends React.Component<Props, State> {
102101
pointerEvents="box-none"
103102
style={styles.appContainer}
104103
ref={ref => {
105-
// $FlowFixMe - Typing ReactNativeComponent revealed errors
106104
this._mainRef = ref;
107105
}}>
108106
{this.props.children}
109107
</View>
110108
);
111109

112110
const Wrapper = this.props.WrapperComponent;
113-
if (Wrapper) {
111+
if (Wrapper != null) {
114112
innerView = <Wrapper>{innerView}</Wrapper>;
115113
}
116114
return (

0 commit comments

Comments
 (0)