@tanstack/router-core 1.155.0 → 1.157.0

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.
@@ -1,4 +1,5 @@
1
1
  import { functionalUpdate } from './utils'
2
+ import { isServer } from './isServer'
2
3
  import type { AnyRouter } from './router'
3
4
  import type { ParsedLocation } from './location'
4
5
  import type { NonNullableUpdater } from './utils'
@@ -217,7 +218,7 @@ export function restoreScroll({
217
218
  /** Setup global listeners and hooks to support scroll restoration. */
218
219
  /** Setup global listeners and hooks to support scroll restoration. */
219
220
  export function setupScrollRestoration(router: AnyRouter, force?: boolean) {
220
- if (!scrollRestorationCache && !router.isServer) {
221
+ if (!scrollRestorationCache && !(isServer ?? router.isServer)) {
221
222
  return
222
223
  }
223
224
  const shouldScrollRestoration =
@@ -228,7 +229,7 @@ export function setupScrollRestoration(router: AnyRouter, force?: boolean) {
228
229
  }
229
230
 
230
231
  if (
231
- router.isServer ||
232
+ (isServer ?? router.isServer) ||
232
233
  router.isScrollRestorationSetup ||
233
234
  !scrollRestorationCache
234
235
  ) {