@@ -81,7 +81,7 @@ export const ActiveRouteLoader = ({
8181 [ path ] : {
8282 page : ArlNullPage ,
8383 state : 'PRE_SHOW' ,
84- location : { ... location } ,
84+ location,
8585 } ,
8686 } ) )
8787
@@ -96,7 +96,7 @@ export const ActiveRouteLoader = ({
9696 [ path ] : {
9797 page : whileLoadingPage || ArlWhileLoadingNullPage ,
9898 state : 'SHOW_LOADING' ,
99- location : { ... location } ,
99+ location,
100100 } ,
101101 } ) )
102102 setRenderedChildren ( children )
@@ -120,7 +120,7 @@ export const ActiveRouteLoader = ({
120120 [ path ] : {
121121 page : module . default ,
122122 state : 'DONE' ,
123- location : { ... location } ,
123+ location,
124124 } ,
125125 } ) )
126126 setRenderedChildren ( children )
@@ -134,18 +134,11 @@ export const ActiveRouteLoader = ({
134134 clearLoadingTimeout ( )
135135 startPageLoadTransition ( spec , delay )
136136 } else {
137- // Handle navigating to the same page again, but with different path params
137+ // Handle navigating to the same page again, but with different path
138+ // params (i.e. new `location`)
138139 setLoadingState ( ( loadingState ) => {
139140 const page = loadingState [ path ] ?. page || ArlNullPage
140-
141- return {
142- ...loadingState ,
143- [ path ] : {
144- page,
145- state : 'DONE' ,
146- location : { ...location } ,
147- } ,
148- }
141+ return { ...loadingState , [ path ] : { page, state : 'DONE' , location } }
149142 } )
150143 }
151144
@@ -167,7 +160,7 @@ export const ActiveRouteLoader = ({
167160 [ path ] : {
168161 state : 'DONE' ,
169162 page : PageFromLoader ,
170- location : { ... location } ,
163+ location,
171164 } ,
172165 }
173166
0 commit comments