RN: Fix $FlowFixMe in AppContainer

Summary: Fixes the `$FlowFixMe` type errors in `AppContainer`.

Reviewed By: TheSavior

Differential Revision: D7987552

fbshipit-source-id: 5eba319aa2661c2d6d8ed24affc066504096b72c
This commit is contained in:
Tim Yung 2018-05-14 17:36:40 -07:00 committed by Facebook Github Bot
parent 206ef54aa4
commit a956551af7
1 changed files with 12 additions and 14 deletions

View File

@ -21,25 +21,24 @@ const View = require('View');
type Context = {
rootTag: number,
};
type Props = {|
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
children?: React.Children,
type Props = $ReadOnly<{|
children?: React.Node,
rootTag: number,
WrapperComponent?: ?React.ComponentType<*>,
|};
type State = {
inspector: ?React.Element<any>,
WrapperComponent?: ?React.ComponentType<any>,
|}>;
type State = {|
inspector: ?React.Node,
mainKey: number,
};
|};
class AppContainer extends React.Component<Props, State> {
state: State = {
inspector: null,
mainKey: 1,
};
_mainRef: ?React.Element<any>;
_mainRef: ?React.ElementRef<typeof View>;
_subscription: ?EmitterSubscription = null;
static childContextTypes = {
@ -81,7 +80,7 @@ class AppContainer extends React.Component<Props, State> {
}
componentWillUnmount(): void {
if (this._subscription) {
if (this._subscription != null) {
this._subscription.remove();
}
}
@ -102,7 +101,6 @@ class AppContainer extends React.Component<Props, State> {
pointerEvents="box-none"
style={styles.appContainer}
ref={ref => {
// $FlowFixMe - Typing ReactNativeComponent revealed errors
this._mainRef = ref;
}}>
{this.props.children}
@ -110,7 +108,7 @@ class AppContainer extends React.Component<Props, State> {
);
const Wrapper = this.props.WrapperComponent;
if (Wrapper) {
if (Wrapper != null) {
innerView = <Wrapper>{innerView}</Wrapper>;
}
return (