Skip to content

Commit

Permalink
Add option to disable inspector in AppContainer to avoid showing it i…
Browse files Browse the repository at this point in the history
…n nested AppContainer views

Summary: Changelog: [internal]

Reviewed By: jacdebug

Differential Revision: D39383213

fbshipit-source-id: 1e3cb7e2d72df1ddbc254c789bd10b12229fe1ae
  • Loading branch information
rubennorte authored and facebook-github-bot committed Sep 9, 2022
1 parent 460153f commit 0f98041
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Libraries/ReactNative/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Props = $ReadOnly<{|
showArchitectureIndicator?: boolean,
WrapperComponent?: ?React.ComponentType<any>,
internal_excludeLogBox?: ?boolean,
internal_excludeInspector?: ?boolean,
|}>;

type State = {|
Expand All @@ -48,7 +49,10 @@ class AppContainer extends React.Component<Props, State> {

componentDidMount(): void {
if (__DEV__) {
if (!global.__RCTProfileIsProfiling) {
if (
!global.__RCTProfileIsProfiling &&
!this.props.internal_excludeInspector
) {
this._subscription = RCTDeviceEventEmitter.addListener(
'toggleElementInspector',
() => {
Expand Down

0 comments on commit 0f98041

Please sign in to comment.