@tanstack/react-router 1.48.0 → 1.48.4
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.
- package/dist/cjs/Transitioner.cjs +2 -2
- package/dist/cjs/Transitioner.cjs.map +1 -1
- package/dist/cjs/router.cjs +1 -0
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +10 -3
- package/dist/esm/Transitioner.js +2 -2
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/esm/router.d.ts +10 -3
- package/dist/esm/router.js +1 -0
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/Transitioner.tsx +2 -2
- package/src/router.ts +11 -3
package/src/Transitioner.tsx
CHANGED
|
@@ -56,7 +56,7 @@ export function Transitioner() {
|
|
|
56
56
|
// Try to load the initial location
|
|
57
57
|
useLayoutEffect(() => {
|
|
58
58
|
if (
|
|
59
|
-
window.__TSR__?.dehydrated ||
|
|
59
|
+
(typeof window !== 'undefined' && window.__TSR__?.dehydrated) ||
|
|
60
60
|
(mountLoadForRouter.current.router === router &&
|
|
61
61
|
mountLoadForRouter.current.mounted)
|
|
62
62
|
) {
|
|
@@ -111,7 +111,7 @@ export function Transitioner() {
|
|
|
111
111
|
resolvedLocation: s.location,
|
|
112
112
|
}))
|
|
113
113
|
|
|
114
|
-
if ((document as any).querySelector) {
|
|
114
|
+
if (typeof document !== 'undefined' && (document as any).querySelector) {
|
|
115
115
|
if (router.state.location.hash !== '') {
|
|
116
116
|
const el = document.getElementById(router.state.location.hash)
|
|
117
117
|
if (el) {
|
package/src/router.ts
CHANGED
|
@@ -249,10 +249,9 @@ export interface RouterOptions<
|
|
|
249
249
|
*/
|
|
250
250
|
defaultPreloadStaleTime?: number
|
|
251
251
|
/**
|
|
252
|
-
* Defaults to `routerOptions.defaultGcTime`, which defaults to 30 minutes.
|
|
253
|
-
*
|
|
254
252
|
* The default `defaultPreloadGcTime` a route should use if no preloadGcTime is provided.
|
|
255
253
|
*
|
|
254
|
+
* @default 1_800_000 `(30 minutes)`
|
|
256
255
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadgctime-property)
|
|
257
256
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
258
257
|
*/
|
|
@@ -265,10 +264,18 @@ export interface RouterOptions<
|
|
|
265
264
|
*/
|
|
266
265
|
defaultOnCatch?: (error: Error, errorInfo: React.ErrorInfo) => void
|
|
267
266
|
/**
|
|
268
|
-
* If
|
|
267
|
+
* If `true`, route navigations will called using `document.startViewTransition()`.
|
|
268
|
+
*
|
|
269
|
+
* If the browser does not support this api, this option will be ignored.
|
|
270
|
+
*
|
|
271
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for more information on how this function works.
|
|
272
|
+
*
|
|
273
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultviewtransition-property)
|
|
269
274
|
*/
|
|
270
275
|
defaultViewTransition?: boolean
|
|
271
276
|
/**
|
|
277
|
+
* @default 'fuzzy'
|
|
278
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundmode-property)
|
|
272
279
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#the-notfoundmode-option)
|
|
273
280
|
*/
|
|
274
281
|
notFoundMode?: 'root' | 'fuzzy'
|
|
@@ -634,6 +641,7 @@ export class Router<
|
|
|
634
641
|
defaultPendingMinMs: 500,
|
|
635
642
|
context: undefined!,
|
|
636
643
|
...options,
|
|
644
|
+
notFoundMode: options.notFoundMode ?? 'fuzzy',
|
|
637
645
|
stringifySearch: options.stringifySearch ?? defaultStringifySearch,
|
|
638
646
|
parseSearch: options.parseSearch ?? defaultParseSearch,
|
|
639
647
|
transformer: options.transformer ?? {
|