Skip to content

Commit

Permalink
RN: Fix $FlowFixMe in AppContainer
Browse files Browse the repository at this point in the history
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 a956551
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Libraries/ReactNative/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -81,7 +80,7 @@ class AppContainer extends React.Component<Props, State> {
}

componentWillUnmount(): void {
if (this._subscription) {
if (this._subscription != null) {
this._subscription.remove();
}
}
Expand All @@ -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 (
Expand Down

0 comments on commit a956551

Please sign in to comment.