Permalink
Browse files

RN: Fix $FlowFixMe in AppContainer

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

Reviewed By: TheSavior

Differential Revision: D7987552

fbshipit-source-id: 5eba319aa2661c2d6d8ed24affc066504096b72c
  • Loading branch information...
yungsters authored and facebook-github-bot committed May 15, 2018
1 parent 206ef54 commit a956551af73cf785ee4345e92e71fd5b17c5644e
Showing with 12 additions and 14 deletions.
  1. +12 −14 Libraries/ReactNative/AppContainer.js
@@ -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,15 +101,14 @@ 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}
</View>
);
const Wrapper = this.props.WrapperComponent;
if (Wrapper) {
if (Wrapper != null) {
innerView = <Wrapper>{innerView}</Wrapper>;
}
return (

0 comments on commit a956551

Please sign in to comment.