Skip to content

Commit

Permalink
Fix inspector on top of Modal
Browse files Browse the repository at this point in the history
Summary:
Very similar to #9600.
Does not trigger on DEV, but there are two inspectors: one underneath and one
above the modal. This looks like something we should fix, but the only solution
I've come up with so far was to mangle the event that AppContainer listens to, so that
only the AppContainer in the modal responds to it. This seems pretty ugly, I'd
rather look for something else. Wdyt?

Reviewed By: frantic

Differential Revision: D3937096

fbshipit-source-id: a6e648b6d583088514d6ba8df7851f9a8ef48f74
  • Loading branch information
andreicoman11 authored and Facebook Github Bot committed Sep 29, 2016
1 parent a75ec11 commit 05de4db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Libraries/Modal/Modal.js
Expand Up @@ -11,6 +11,7 @@
*/
'use strict';

const AppContainer = require('AppContainer');
const I18nManager = require('I18nManager');
const Platform = require('Platform');
const PropTypes = require('react/lib/ReactPropTypes');
Expand Down Expand Up @@ -146,6 +147,12 @@ class Modal extends React.Component {
}
}

const innerChildren = __DEV__ ?
( <AppContainer>
{this.props.children}
</AppContainer>) :
this.props.children;

return (
<RCTModalHostView
animationType={animationType}
Expand All @@ -158,7 +165,7 @@ class Modal extends React.Component {
onOrientationChange={this.props.onOrientationChange}
>
<View style={[styles.container, containerStyles]}>
{this.props.children}
{innerChildren}
</View>
</RCTModalHostView>
);
Expand Down

0 comments on commit 05de4db

Please sign in to comment.