@tanstack/router-core 1.154.12 → 1.154.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -340,8 +340,8 @@ export function setupScrollRestoration(router: AnyRouter, force?: boolean) {
340
340
 
341
341
  // If the user doesn't want to restore the scroll position,
342
342
  // we don't need to do anything.
343
- const resetScroll = event.toLocation.state.__TSR_resetScroll ?? true
344
- if (!resetScroll) {
343
+ if (!router.resetNextScroll) {
344
+ router.resetNextScroll = true
345
345
  return
346
346
  }
347
347
  if (typeof router.options.scrollRestoration === 'function') {
package/src/utils.ts CHANGED
@@ -188,7 +188,7 @@ export type LooseAsyncReturnType<T> = T extends (
188
188
  * Return the last element of an array.
189
189
  * Intended for non-empty arrays used within router internals.
190
190
  */
191
- export function last<T>(arr: Array<T>) {
191
+ export function last<T>(arr: ReadonlyArray<T>) {
192
192
  return arr[arr.length - 1]
193
193
  }
194
194