File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
entrypoints/inspector_main Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,25 @@ Common.Runnable.registerEarlyInitializationRunnable(InspectorMainImpl.instance);
122122
123123export class ReloadActionDelegate implements UI . ActionRegistration . ActionDelegate {
124124 handleAction ( _context : UI . Context . Context , actionId : string ) : boolean {
125+ const isReactNative = Root . Runtime . experiments . isEnabled (
126+ Root . Runtime . ExperimentName . REACT_NATIVE_SPECIFIC_UI ,
127+ ) ;
128+
129+ // [RN] Fork reload handling. React Native targets do not initialize
130+ // ResourceTreeModel (Capability.DOM), and there is no hard reload concept.
131+ if ( isReactNative ) {
132+ switch ( actionId ) {
133+ case 'inspector-main.reload' :
134+ case 'inspector-main.hard-reload' :
135+ const mainTarget = SDK . TargetManager . TargetManager . instance ( ) . primaryPageTarget ( ) ;
136+ if ( ! mainTarget ) {
137+ return false ;
138+ }
139+ void mainTarget . pageAgent ( ) . invoke_reload ( { ignoreCache : true } ) ;
140+ return true ;
141+ }
142+ }
143+
125144 switch ( actionId ) {
126145 case 'inspector-main.reload' :
127146 SDK . ResourceTreeModel . ResourceTreeModel . reloadAllPages ( false ) ;
Original file line number Diff line number Diff line change @@ -202,7 +202,8 @@ export class ReactDevToolsModel extends SDK.SDKModel.SDKModel<EventTypes> {
202202 }
203203
204204 #handleReloadAppForProfiling( ) : void {
205- SDK . ResourceTreeModel . ResourceTreeModel . reloadAllPages ( false ) ;
205+ const mainTarget = SDK . TargetManager . TargetManager . instance ( ) . primaryPageTarget ( ) ;
206+ void mainTarget ?. pageAgent ( ) . invoke_reload ( { ignoreCache : true } ) ;
206207 }
207208
208209 #handleBackendExecutionContextUnavailable( { data : errorMessage } : ReactDevToolsBindingsBackendExecutionContextUnavailableEvent ) : void {
You can’t perform that action at this time.
0 commit comments