@tanstack/router-core 1.136.13 → 1.136.15
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/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +4 -2
- package/dist/cjs/router.cjs +7 -3
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/route.d.ts +4 -2
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.js +7 -3
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/route.ts +5 -3
- package/src/router.ts +8 -4
package/src/route.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
RouteMatch,
|
|
15
15
|
} from './Matches'
|
|
16
16
|
import type { RootRouteId } from './root'
|
|
17
|
-
import type { ParseRoute, RouteById, RoutePaths } from './routeInfo'
|
|
17
|
+
import type { ParseRoute, RouteById, RouteIds, RoutePaths } from './routeInfo'
|
|
18
18
|
import type { AnyRouter, Register, RegisteredRouter, SSROption } from './router'
|
|
19
19
|
import type { BuildLocationFn, NavigateFn } from './RouterProvider'
|
|
20
20
|
import type {
|
|
@@ -1488,9 +1488,11 @@ export type ErrorComponentProps<TError = Error> = {
|
|
|
1488
1488
|
info?: { componentStack: string }
|
|
1489
1489
|
reset: () => void
|
|
1490
1490
|
}
|
|
1491
|
+
|
|
1491
1492
|
export type NotFoundRouteProps = {
|
|
1492
|
-
|
|
1493
|
-
|
|
1493
|
+
data?: unknown
|
|
1494
|
+
isNotFound: boolean
|
|
1495
|
+
routeId: RouteIds<RegisteredRouter['routeTree']>
|
|
1494
1496
|
}
|
|
1495
1497
|
|
|
1496
1498
|
export class BaseRoute<
|
package/src/router.ts
CHANGED
|
@@ -1388,7 +1388,7 @@ export class RouterCore<
|
|
|
1388
1388
|
|
|
1389
1389
|
const strictParams = existingMatch?._strictParams ?? usedParams
|
|
1390
1390
|
|
|
1391
|
-
let paramsError:
|
|
1391
|
+
let paramsError: unknown = undefined
|
|
1392
1392
|
|
|
1393
1393
|
if (!existingMatch) {
|
|
1394
1394
|
const strictParseParams =
|
|
@@ -1401,9 +1401,13 @@ export class RouterCore<
|
|
|
1401
1401
|
strictParseParams(strictParams as Record<string, string>),
|
|
1402
1402
|
)
|
|
1403
1403
|
} catch (err: any) {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
}
|
|
1404
|
+
if (isNotFound(err) || isRedirect(err)) {
|
|
1405
|
+
paramsError = err
|
|
1406
|
+
} else {
|
|
1407
|
+
paramsError = new PathParamError(err.message, {
|
|
1408
|
+
cause: err,
|
|
1409
|
+
})
|
|
1410
|
+
}
|
|
1407
1411
|
|
|
1408
1412
|
if (opts?.throwOnError) {
|
|
1409
1413
|
throw paramsError
|