@tanstack/react-router 1.99.0 → 1.99.7
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/router.cjs +6 -0
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/Match.js +3 -3
- package/dist/esm/link.js +1 -1
- package/dist/esm/router.js +7 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +3 -3
- package/src/router.ts +7 -0
package/dist/esm/Match.js
CHANGED
|
@@ -2,11 +2,11 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import invariant from "tiny-invariant";
|
|
4
4
|
import warning from "tiny-warning";
|
|
5
|
-
import { rootRouteId,
|
|
6
|
-
import {
|
|
5
|
+
import { rootRouteId, pick, createControlledPromise, getLocationChangeInfo } from "@tanstack/router-core";
|
|
6
|
+
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
7
7
|
import { useRouterState } from "./useRouterState.js";
|
|
8
8
|
import { useRouter } from "./useRouter.js";
|
|
9
|
-
import {
|
|
9
|
+
import { CatchNotFound, isNotFound } from "./not-found.js";
|
|
10
10
|
import { isRedirect } from "./redirects.js";
|
|
11
11
|
import { matchContext } from "./matchContext.js";
|
|
12
12
|
import { SafeFragment } from "./SafeFragment.js";
|
package/dist/esm/link.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { flushSync } from "react-dom";
|
|
4
|
-
import {
|
|
4
|
+
import { preloadWarning, functionalUpdate, exactPathTest, removeTrailingSlash, deepEqual } from "@tanstack/router-core";
|
|
5
5
|
import { useRouterState } from "./useRouterState.js";
|
|
6
6
|
import { useRouter } from "./useRouter.js";
|
|
7
7
|
import { useForwardedRef, useIntersectionObserver, useLayoutEffect } from "./utils.js";
|
package/dist/esm/router.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createMemoryHistory, createBrowserHistory, parseHref } from "@tanstack/history";
|
|
2
2
|
import { Store, batch } from "@tanstack/react-store";
|
|
3
3
|
import invariant from "tiny-invariant";
|
|
4
|
-
import { trimPath, trimPathLeft, parsePathname, resolvePath, cleanPath, trimPathRight, rootRouteId, pick, createControlledPromise, getLocationChangeInfo, matchPathname, deepEqual,
|
|
4
|
+
import { trimPath, trimPathLeft, parsePathname, resolvePath, cleanPath, trimPathRight, rootRouteId, pick, createControlledPromise, getLocationChangeInfo, matchPathname, deepEqual, defaultParseSearch, defaultStringifySearch, interpolatePath, replaceEqualDeep, joinPaths, last, functionalUpdate } from "@tanstack/router-core";
|
|
5
5
|
import { isResolvedRedirect, isRedirect } from "./redirects.js";
|
|
6
6
|
import { isNotFound } from "./not-found.js";
|
|
7
7
|
import { setupScrollRestoration } from "./scroll-restoration.js";
|
|
@@ -747,6 +747,12 @@ class Router {
|
|
|
747
747
|
while (this.latestLoadPromise && loadPromise !== this.latestLoadPromise) {
|
|
748
748
|
await this.latestLoadPromise;
|
|
749
749
|
}
|
|
750
|
+
if (this.hasNotFoundMatch()) {
|
|
751
|
+
this.__store.setState((s) => ({
|
|
752
|
+
...s,
|
|
753
|
+
statusCode: 404
|
|
754
|
+
}));
|
|
755
|
+
}
|
|
750
756
|
};
|
|
751
757
|
this.startViewTransition = (fn) => {
|
|
752
758
|
const shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition;
|