@@ -1008,6 +1008,16 @@ export function createRouter(init: RouterInit): Router {
10081008 inFlightDataRoutes = undefined ;
10091009 }
10101010
1011+ if ( isUninterruptedRevalidation ) {
1012+ // If this was an uninterrupted revalidation then do not touch history
1013+ } else if ( pendingAction === HistoryAction . Pop ) {
1014+ // Do nothing for POP - URL has already been updated
1015+ } else if ( pendingAction === HistoryAction . Push ) {
1016+ init . history . push ( location , location . state ) ;
1017+ } else if ( pendingAction === HistoryAction . Replace ) {
1018+ init . history . replace ( location , location . state ) ;
1019+ }
1020+
10111021 updateState ( {
10121022 ...newState , // matches, errors, fetchers go through as-is
10131023 actionData,
@@ -1025,16 +1035,6 @@ export function createRouter(init: RouterInit): Router {
10251035 blockers : new Map ( state . blockers ) ,
10261036 } ) ;
10271037
1028- if ( isUninterruptedRevalidation ) {
1029- // If this was an uninterrupted revalidation then do not touch history
1030- } else if ( pendingAction === HistoryAction . Pop ) {
1031- // Do nothing for POP - URL has already been updated
1032- } else if ( pendingAction === HistoryAction . Push ) {
1033- init . history . push ( location , location . state ) ;
1034- } else if ( pendingAction === HistoryAction . Replace ) {
1035- init . history . replace ( location , location . state ) ;
1036- }
1037-
10381038 // Reset stateful navigation vars
10391039 pendingAction = HistoryAction . Pop ;
10401040 pendingPreventScrollReset = false ;
0 commit comments