@@ -52,26 +52,28 @@ class AppContainer extends React.Component {
5252
5353 componentDidMount ( ) : void {
5454 if ( __DEV__ ) {
55- this . _subscription = RCTDeviceEventEmitter . addListener (
56- 'toggleElementInspector' ,
57- ( ) => {
58- const Inspector = require ( 'Inspector' ) ;
59- const inspector = this . state . inspector
60- ? null
61- : < Inspector
62- inspectedViewTag = { ReactNative . findNodeHandle ( this . _mainRef ) }
63- onRequestRerenderApp = { ( updateInspectedViewTag ) => {
64- this . setState (
65- ( s ) => ( { mainKey : s . mainKey + 1 } ) ,
66- ( ) => updateInspectedViewTag (
67- ReactNative . findNodeHandle ( this . _mainRef )
68- )
69- ) ;
70- } }
71- /> ;
72- this . setState ( { inspector} ) ;
73- } ,
74- ) ;
55+ if ( global . __RCTProfileIsProfiling ) {
56+ this . _subscription = RCTDeviceEventEmitter . addListener (
57+ 'toggleElementInspector' ,
58+ ( ) => {
59+ const Inspector = require ( 'Inspector' ) ;
60+ const inspector = this . state . inspector
61+ ? null
62+ : < Inspector
63+ inspectedViewTag = { ReactNative . findNodeHandle ( this . _mainRef ) }
64+ onRequestRerenderApp = { ( updateInspectedViewTag ) => {
65+ this . setState (
66+ ( s ) => ( { mainKey : s . mainKey + 1 } ) ,
67+ ( ) => updateInspectedViewTag (
68+ ReactNative . findNodeHandle ( this . _mainRef )
69+ )
70+ ) ;
71+ } }
72+ /> ;
73+ this . setState ( { inspector} ) ;
74+ } ,
75+ ) ;
76+ }
7577 }
7678 }
7779
@@ -84,8 +86,10 @@ class AppContainer extends React.Component {
8486 render ( ) : React . Element < * > {
8587 let yellowBox = null ;
8688 if ( __DEV__ ) {
87- const YellowBox = require ( 'YellowBox' ) ;
88- yellowBox = < YellowBox /> ;
89+ if ( ! global . __RCTProfileIsProfiling ) {
90+ const YellowBox = require ( 'YellowBox' ) ;
91+ yellowBox = < YellowBox /> ;
92+ }
8993 }
9094
9195 return (
0 commit comments