diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js index ce4a78043a4fff..ad5f8c06a35f02 100644 --- a/Libraries/ReactNative/AppContainer.js +++ b/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, + WrapperComponent?: ?React.ComponentType, +|}>; + +type State = {| + inspector: ?React.Node, mainKey: number, -}; +|}; class AppContainer extends React.Component { state: State = { inspector: null, mainKey: 1, }; - _mainRef: ?React.Element; + _mainRef: ?React.ElementRef; _subscription: ?EmitterSubscription = null; static childContextTypes = { @@ -81,7 +80,7 @@ class AppContainer extends React.Component { } componentWillUnmount(): void { - if (this._subscription) { + if (this._subscription != null) { this._subscription.remove(); } } @@ -102,7 +101,6 @@ class AppContainer extends React.Component { 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 { ); const Wrapper = this.props.WrapperComponent; - if (Wrapper) { + if (Wrapper != null) { innerView = {innerView}; } return (