Repository: TanStack/router
Pull request #2247 (2024-09-02 10:09:21)

fix(react-router): `pendingComponent` not rendering with preload='intent'
Hi, I tried fixing this issue #2008. If route had preload: 'intent' enabled, the pendingComponent would not show, UI just waited for promise to end, and then it would switch route. I found out, that triggerOnReady() in router.ts weren't used if route had beforeLoadPromise or loaderPromise to await for.

https://github.com/user-attachments/assets/960609ad-1e4f-4cf9-a376-ad32f16e3e2a


https://github.com/user-attachments/assets/7701b0ba-4def-42a9-b543-89f26e9003bb



nx-cloud[bot]: # ☁️ Nx Cloud Report

CI is running for commit fdaf02262677929cfe6296d6d6b7c4668f25fc07.

[📂 Click to track the progress, see the status, the terminal output, and the build insights.](https://cloud.nx.app/cipes/66d5a718cbbca9647267f831?utm_source=pull-request&utm_medium=comment)


---

Sent with 💌 from [NxCloud.](https://nx.app?utm_source=pull-request&utm_medium=comment)
pkg-pr-new[bot]: 
[Open in Stackblitz](https://pkg.pr.new/template/75cdb933-345c-4cac-905c-0439d44cb4ce)
<details><summary><b>More templates</b></summary><p>

- [tanstack-router-react-example-authenticated-routes](https://pkg.pr.new/template/41046cde-7efe-40aa-9a48-7ac953a65e83)
- [tanstack-router-react-example-basic](https://pkg.pr.new/template/8c5ded2b-1cf2-4ac4-848c-428fab18d235)
- [tanstack-router-react-example-basic-default-search-params](https://pkg.pr.new/template/4abc16f5-fcb9-458d-8458-5a32b2a78796)
- [tanstack-router-react-example-basic-file-based](https://pkg.pr.new/template/0b32f601-5e06-4aec-b442-6725a9ebed58)
- [tanstack-router-react-example-basic-file-based-codesplitting](https://pkg.pr.new/template/e8531f7d-7e04-4243-b4b3-e740913d06c3)
- [tanstack-router-react-example-react-query](https://pkg.pr.new/template/db4daee6-7b92-4819-b680-6e81b3350352)
- [tanstack-router-react-example-basic-react-query-file-based](https://pkg.pr.new/template/2a24056d-36fa-4cee-8933-fd13f6b788f0)
- [tanstack-router-react-example-basic-ssr-file-based](https://pkg.pr.new/template/e216befc-8621-487b-b66c-91384207054d)
- [tanstack-router-react-example-basic-ssr-streaming-file-based](https://pkg.pr.new/template/a932c5cc-5328-45f5-bfc9-fefe08c5448e)
- [tanstack-router-react-example-deferred-data](https://pkg.pr.new/template/d94e00a4-b001-4103-b312-f8cef91b1a3f)
- [tanstack-router-react-example-kitchen-sink](https://pkg.pr.new/template/10c15bb5-9d5c-4db2-93ec-deaecf7dc978)
- [tanstack-router-react-example-kitchen-sink-file-based](https://pkg.pr.new/template/0c9f6d8a-80d8-493e-920f-0bbba4b70aa5)
- [tanstack-router-react-example-kitchen-sink-react-query](https://pkg.pr.new/template/3fccc6a7-fb91-49f4-a250-5cf69aa20469)
- [tanstack-router-react-example-kitchen-sink-react-query-file-based](https://pkg.pr.new/template/7e0c736e-b97b-41f2-a39c-76e626ac78ba)
- [tanstack-router-react-example-large-file-based](https://pkg.pr.new/template/5e5145f2-eb67-4bdd-9478-8d00c0990e9a)
- [tanstack-router-react-example-location-masking](https://pkg.pr.new/template/295d18c1-006a-4269-b40f-d3cea46fd00f)
- [tanstack-router-react-example-navigation-blocking](https://pkg.pr.new/template/d5f76a79-11af-474d-b2c0-c99c0d870a3b)
- [tanstack-router-react-example-quickstart](https://pkg.pr.new/template/8c4db094-53c4-41df-9e0a-8e197ca08039)
- [tanstack-router-react-example-quickstart-file-based](https://pkg.pr.new/template/76f65c04-6559-41c3-8f5c-048043dc0cbe)
- [tanstack-router-react-example-quickstart-rspack-file-based](https://pkg.pr.new/template/0a0088b9-3c64-4632-88bd-f141ad7f26eb)
- [tanstack-router-react-example-quickstart-webpack-file-based](https://pkg.pr.new/template/a18511a1-b0c0-416a-b9ce-0a725ea2de92)
- [tanstack-router-react-example-scroll-restoration](https://pkg.pr.new/template/a3f45009-bcc0-4fc5-b40d-55092b1422a5)
- [tanstack-router-search-validator-adapters](https://pkg.pr.new/template/9c1721ee-c5ed-43f6-b2d0-aa176dee6218)
- [tanstack-router-example-react-start-basic](https://pkg.pr.new/template/78e7f16f-4d3b-4644-8d1d-575e41423db2)
- [tanstack-router-example-react-start-basic-auth](https://pkg.pr.new/template/b4b8b49e-e380-46cd-b00c-74ad6aab55b3)
- [tanstack-router-example-react-start-basic-counter](https://pkg.pr.new/template/d23df28a-4f98-4a81-b37d-a2abefc333f1)
- [tanstack-router-example-react-start-basic-react-query](https://pkg.pr.new/template/e0dd1950-ec97-4b95-b762-fe8887c86321)
- [tanstack-router-example-react-start-basic-rsc](https://pkg.pr.new/template/4913fcbd-ad28-4f16-a3a4-d1fe79c63ea5)
- [tanstack-router-example-react-start-clerk-basic](https://pkg.pr.new/template/ca8c5726-8c79-4587-9d9d-c4d366cbd66b)
- [tanstack-router-example-react-start-trello-trellaux](https://pkg.pr.new/template/99c4fbff-1f8b-4080-9350-28e1e001902c)
- [tanstack-router-example-react-start-trellaux](https://pkg.pr.new/template/af72a27b-852b-481f-a6c9-c0a790e6d830)
- [tanstack-router-react-example-with-framer-motion](https://pkg.pr.new/template/fe7e377e-b3a6-4ac4-86e6-198cea06f5ac)
- [tanstack-router-react-example-with-trpc](https://pkg.pr.new/template/e9d99dc0-ba7e-4f59-adb6-cf8ddbdf297c)
- [tanstack-router-react-example-with-trpc-react-query](https://pkg.pr.new/template/5f43eb19-de14-4cd6-a0e5-fd90d65fc409)

</p></details>
      
    


<details><summary><b>@tanstack/history</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/history@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/react-cross-context</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/react-cross-context@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/react-router</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/react-router@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/react-router-with-query</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/react-router-with-query@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-arktype-adapter</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-arktype-adapter@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-cli</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-cli@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-devtools</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-devtools@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-generator</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-generator@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-plugin</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-plugin@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-valibot-adapter</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-valibot-adapter@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-vite-plugin</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-vite-plugin@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/router-zod-adapter</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/router-zod-adapter@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/start</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/start@2247
```

</p></details>
      
    

<details><summary><b>@tanstack/start-vite-plugin</b></summary><p>

```
pnpm add https://pkg.pr.new/@tanstack/start-vite-plugin@2247
```

</p></details>
      
    

_commit: <a href="https://github.com/TanStack/router/runs/29562488067"><code>fdaf022</code></a>_


Patch:
diff --git a/docs/framework/react/guide/route-trees.md b/docs/framework/react/guide/route-trees.md
index 85d2c0e7d..b9ed2231f 100644
--- a/docs/framework/react/guide/route-trees.md
+++ b/docs/framework/react/guide/route-trees.md
@@ -61,9 +61,9 @@ The above is a valid route tree configuration that can be used with TanStack Rou
 
 Route trees can be configured using a few different ways:
 
-- [Flat Routes](./route-trees.md#flat-routes)
-- [Directories](./route-trees.md#directory-routes)
-- [Mixed Flat Routes and Directories](./route-trees.md#mixed-flat-and-directory-routes)
-- [Code-Based Routes](./route-trees.md#code-based-routes)
+- [Flat Routes](./file-based-routing.md#flat-routes)
+- [Directories](./file-based-routing.md#directory-routes)
+- [Mixed Flat Routes and Directories](./file-based-routing.md#mixed-flat-and-directory-routes)
+- [Code-Based Routes](./code-based-routing.md)
 
-For a birds-eye view, the route tree examples below showcase the [Routing Concepts](./routing-concepts.md) that are available in TanStack Router, but please be sure to check out the full documentation links above for each type of route tree, or just proceed to the next section to get started with file-based routing.
+Please be sure to check out the full documentation links above for each type of route tree, or just proceed to the next section to get started with file-based routing.
diff --git a/docs/framework/react/guide/routing-concepts.md b/docs/framework/react/guide/routing-concepts.md
index cafa3d5e4..b3febed35 100644
--- a/docs/framework/react/guide/routing-concepts.md
+++ b/docs/framework/react/guide/routing-concepts.md
@@ -8,7 +8,7 @@ TanStack Router supports a number of powerful routing concepts that allow you to
 - [Static Routes](./routing-concepts.md#static-routes)
 - [Index Routes](./routing-concepts.md#index-routes)
 - [Dynamic Route Segments](./routing-concepts.md#dynamic-route-segments)
-- [Splat / Catch-All Routes](./routing-concept.md#splat--catch-all-routes)
+- [Splat / Catch-All Routes](./routing-concepts.md#splat--catch-all-routes)
 - [Pathless Routes](./routing-concepts.md#pathless--layout-routes)
 - [Non-Nested Routes](./routing-concepts.md#non-nested-routes)
 - [Not-Found Routes](./routing-concepts.md#404--notfoundroutes)
diff --git a/docs/framework/react/start/getting-started.md b/docs/framework/react/start/getting-started.md
index 8b9acae24..240e6b2fa 100644
--- a/docs/framework/react/start/getting-started.md
+++ b/docs/framework/react/start/getting-started.md
@@ -32,7 +32,7 @@ Create a `tsconfig.json` file with at least the following settings:
   "compilerOptions": {
     "jsx": "react-jsx",
     "moduleResolution": "Bundler",
-    "module": "Preserve",
+    "module": "ESNext",
     "target": "ES2022",
     "skipLibCheck": true,
   },
diff --git a/examples/react/authenticated-routes/package.json b/examples/react/authenticated-routes/package.json
index 67a45212b..7b81c77f3 100644
--- a/examples/react/authenticated-routes/package.json
+++ b/examples/react/authenticated-routes/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/basic-default-search-params/package.json b/examples/react/basic-default-search-params/package.json
index 1f60d824c..b6ec2c0a6 100644
--- a/examples/react/basic-default-search-params/package.json
+++ b/examples/react/basic-default-search-params/package.json
@@ -10,8 +10,8 @@
   },
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-file-based-codesplitting/package.json b/examples/react/basic-file-based-codesplitting/package.json
index 0fcf5465e..11c21f5f2 100644
--- a/examples/react/basic-file-based-codesplitting/package.json
+++ b/examples/react/basic-file-based-codesplitting/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/basic-file-based/package.json b/examples/react/basic-file-based/package.json
index 7fa7fd3fe..8be70d214 100644
--- a/examples/react/basic-file-based/package.json
+++ b/examples/react/basic-file-based/package.json
@@ -10,8 +10,8 @@
     "test:e2e": "playwright test --project=chromium"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/basic-react-query-file-based/package.json b/examples/react/basic-react-query-file-based/package.json
index 5fed43c5a..a7cdb071d 100644
--- a/examples/react/basic-react-query-file-based/package.json
+++ b/examples/react/basic-react-query-file-based/package.json
@@ -12,8 +12,8 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/basic-react-query/package.json b/examples/react/basic-react-query/package.json
index fde99974c..afc0513b0 100644
--- a/examples/react/basic-react-query/package.json
+++ b/examples/react/basic-react-query/package.json
@@ -12,8 +12,8 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
     "redaxios": "^0.5.1"
diff --git a/examples/react/basic-ssr-file-based/package.json b/examples/react/basic-ssr-file-based/package.json
index a60cc66a9..7c05b3342 100644
--- a/examples/react/basic-ssr-file-based/package.json
+++ b/examples/react/basic-ssr-file-based/package.json
@@ -11,10 +11,10 @@
     "debug": "node --inspect-brk server"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "get-port": "^7.1.0",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-ssr-streaming-file-based/package.json b/examples/react/basic-ssr-streaming-file-based/package.json
index c4dd02d06..7e1798192 100644
--- a/examples/react/basic-ssr-streaming-file-based/package.json
+++ b/examples/react/basic-ssr-streaming-file-based/package.json
@@ -11,10 +11,10 @@
     "debug": "node --inspect-brk server"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "get-port": "^7.1.0",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic/package.json b/examples/react/basic/package.json
index 963ba87f5..3d42b884b 100644
--- a/examples/react/basic/package.json
+++ b/examples/react/basic/package.json
@@ -10,8 +10,8 @@
     "test:e2e": "playwright test --project=chromium"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
     "redaxios": "^0.5.1"
diff --git a/examples/react/deferred-data/package.json b/examples/react/deferred-data/package.json
index 11181b0d1..5e51819f4 100644
--- a/examples/react/deferred-data/package.json
+++ b/examples/react/deferred-data/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "redaxios": "^0.5.1",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/kitchen-sink-file-based/package.json b/examples/react/kitchen-sink-file-based/package.json
index d090299e7..48d3241b8 100644
--- a/examples/react/kitchen-sink-file-based/package.json
+++ b/examples/react/kitchen-sink-file-based/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/kitchen-sink-react-query-file-based/package.json b/examples/react/kitchen-sink-react-query-file-based/package.json
index f7f19cb9c..5e52f1fcb 100644
--- a/examples/react/kitchen-sink-react-query-file-based/package.json
+++ b/examples/react/kitchen-sink-react-query-file-based/package.json
@@ -11,8 +11,8 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/kitchen-sink-react-query/package.json b/examples/react/kitchen-sink-react-query/package.json
index 879f64ef0..52e7ba7b5 100644
--- a/examples/react/kitchen-sink-react-query/package.json
+++ b/examples/react/kitchen-sink-react-query/package.json
@@ -11,8 +11,8 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "redaxios": "^0.5.1",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/kitchen-sink/package.json b/examples/react/kitchen-sink/package.json
index 3f7df7a31..3f82bc0f5 100644
--- a/examples/react/kitchen-sink/package.json
+++ b/examples/react/kitchen-sink/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "redaxios": "^0.5.1",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/large-file-based/package.json b/examples/react/large-file-based/package.json
index a3e6954c9..171c224d0 100644
--- a/examples/react/large-file-based/package.json
+++ b/examples/react/large-file-based/package.json
@@ -12,8 +12,8 @@
   },
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/location-masking/package.json b/examples/react/location-masking/package.json
index ba5cf21a2..507c7be21 100644
--- a/examples/react/location-masking/package.json
+++ b/examples/react/location-masking/package.json
@@ -11,8 +11,8 @@
   "dependencies": {
     "@radix-ui/react-dialog": "^1.1.1",
     "@tanstack/react-query": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
diff --git a/examples/react/navigation-blocking/package.json b/examples/react/navigation-blocking/package.json
index 8627ea50a..5b8c08cb3 100644
--- a/examples/react/navigation-blocking/package.json
+++ b/examples/react/navigation-blocking/package.json
@@ -10,8 +10,8 @@
   },
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
diff --git a/examples/react/quickstart-file-based/package.json b/examples/react/quickstart-file-based/package.json
index 03fdc131f..965356684 100644
--- a/examples/react/quickstart-file-based/package.json
+++ b/examples/react/quickstart-file-based/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/quickstart-rspack-file-based/package.json b/examples/react/quickstart-rspack-file-based/package.json
index 4e5a3aee2..c597ce714 100644
--- a/examples/react/quickstart-rspack-file-based/package.json
+++ b/examples/react/quickstart-rspack-file-based/package.json
@@ -8,8 +8,8 @@
     "preview": "rsbuild preview"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "react": "^18.3.1",
     "react-dom": "^18.3.1"
   },
diff --git a/examples/react/quickstart-webpack-file-based/package.json b/examples/react/quickstart-webpack-file-based/package.json
index 6449b2123..77c7166eb 100644
--- a/examples/react/quickstart-webpack-file-based/package.json
+++ b/examples/react/quickstart-webpack-file-based/package.json
@@ -7,8 +7,8 @@
     "build": "webpack build"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "react": "^18.3.1",
     "react-dom": "^18.3.1"
   },
diff --git a/examples/react/quickstart/package.json b/examples/react/quickstart/package.json
index fbc7e7014..976ea2262 100644
--- a/examples/react/quickstart/package.json
+++ b/examples/react/quickstart/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
   },
diff --git a/examples/react/scroll-restoration/package.json b/examples/react/scroll-restoration/package.json
index b2460093a..3a9f33d72 100644
--- a/examples/react/scroll-restoration/package.json
+++ b/examples/react/scroll-restoration/package.json
@@ -9,9 +9,9 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
     "@tanstack/react-virtual": "^3.8.4",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/router-devtools": "^1.52.4",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
   },
diff --git a/examples/react/search-validator-adapters/package.json b/examples/react/search-validator-adapters/package.json
index c9b4df1d4..054773fd7 100644
--- a/examples/react/search-validator-adapters/package.json
+++ b/examples/react/search-validator-adapters/package.json
@@ -9,12 +9,12 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/router-zod-adapter": "^1.52.3",
-    "@tanstack/router-valibot-adapter": "^1.52.3",
-    "@tanstack/router-arktype-adapter": "^1.52.3",
+    "@tanstack/router-zod-adapter": "^1.52.4",
+    "@tanstack/router-valibot-adapter": "^1.52.4",
+    "@tanstack/router-arktype-adapter": "^1.52.4",
     "@tanstack/react-query": "^5.51.21",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/start-basic-auth/package.json b/examples/react/start-basic-auth/package.json
index 6717aeda9..4f05f20a0 100644
--- a/examples/react/start-basic-auth/package.json
+++ b/examples/react/start-basic-auth/package.json
@@ -14,10 +14,10 @@
   },
   "dependencies": {
     "@prisma/client": "5.17.0",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "@vitejs/plugin-react": "^4.3.1",
     "dotenv": "^16.4.5",
     "isbot": "^5.1.12",
diff --git a/examples/react/start-basic-counter/package.json b/examples/react/start-basic-counter/package.json
index 42f685130..b6ffc2a46 100644
--- a/examples/react/start-basic-counter/package.json
+++ b/examples/react/start-basic-counter/package.json
@@ -11,8 +11,8 @@
     "format": "prettier --write '**/*' --ignore-unknown"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/start": "^1.52.4",
     "react": "^18.3.1",
     "react-dom": "^18.3.1",
     "vinxi": "0.4.2"
diff --git a/examples/react/start-basic-react-query/package.json b/examples/react/start-basic-react-query/package.json
index 43b8677a8..3f8328c64 100644
--- a/examples/react/start-basic-react-query/package.json
+++ b/examples/react/start-basic-react-query/package.json
@@ -14,11 +14,11 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/react-router-with-query": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/react-router-with-query": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "@vitejs/plugin-react": "^4.3.1",
     "isbot": "^5.1.14",
     "react": "^18.3.1",
diff --git a/examples/react/start-basic-rsc/package.json b/examples/react/start-basic-rsc/package.json
index 7df94f148..feff4695a 100644
--- a/examples/react/start-basic-rsc/package.json
+++ b/examples/react/start-basic-rsc/package.json
@@ -12,10 +12,10 @@
   },
   "dependencies": {
     "@babel/plugin-syntax-typescript": "^7.24.7",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "redaxios": "^0.5.1",
     "tailwind-merge": "^2.5.2",
     "vinxi": "0.4.2"
diff --git a/examples/react/start-basic/package.json b/examples/react/start-basic/package.json
index 6e630518a..f2f7def99 100644
--- a/examples/react/start-basic/package.json
+++ b/examples/react/start-basic/package.json
@@ -12,10 +12,10 @@
     "test:e2e": "playwright test --project=chromium"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "@vitejs/plugin-react": "^4.3.1",
     "isbot": "^5.1.14",
     "react": "^18.3.1",
diff --git a/examples/react/start-clerk-basic/package.json b/examples/react/start-clerk-basic/package.json
index cbed6a941..646140da5 100644
--- a/examples/react/start-clerk-basic/package.json
+++ b/examples/react/start-clerk-basic/package.json
@@ -13,10 +13,10 @@
   },
   "dependencies": {
     "@clerk/tanstack-start": "0.3.0-snapshot.vdf04997",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "@vitejs/plugin-react": "^4.3.1",
     "dotenv": "^16.4.5",
     "isbot": "^5.1.12",
diff --git a/examples/react/start-convex-trellaux/package.json b/examples/react/start-convex-trellaux/package.json
index df3fb1873..08850f574 100644
--- a/examples/react/start-convex-trellaux/package.json
+++ b/examples/react/start-convex-trellaux/package.json
@@ -15,11 +15,11 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/react-router-with-query": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/react-router-with-query": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "@vitejs/plugin-react": "^4.3.1",
     "@convex-dev/react-query": "0.0.0-alpha.5",
     "concurrently": "^8.2.2",
diff --git a/examples/react/start-trellaux/package.json b/examples/react/start-trellaux/package.json
index d91cef99a..2c017a27b 100644
--- a/examples/react/start-trellaux/package.json
+++ b/examples/react/start-trellaux/package.json
@@ -13,11 +13,11 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/react-router-with-query": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/react-router-with-query": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
-    "@tanstack/start": "^1.52.3",
+    "@tanstack/start": "^1.52.4",
     "@vitejs/plugin-react": "^4.3.1",
     "isbot": "^5.1.14",
     "ky": "^1.5.0",
diff --git a/examples/react/with-framer-motion/package.json b/examples/react/with-framer-motion/package.json
index 2078468f9..7ffb146d2 100644
--- a/examples/react/with-framer-motion/package.json
+++ b/examples/react/with-framer-motion/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "redaxios": "^0.5.1",
     "framer-motion": "^11.3.21",
     "immer": "^10.1.1",
diff --git a/examples/react/with-trpc-react-query/package.json b/examples/react/with-trpc-react-query/package.json
index 593435a07..610f76784 100644
--- a/examples/react/with-trpc-react-query/package.json
+++ b/examples/react/with-trpc-react-query/package.json
@@ -10,8 +10,8 @@
   "dependencies": {
     "@tanstack/react-query": "^5.51.21",
     "@tanstack/react-query-devtools": "^5.51.21",
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "@trpc/client": "11.0.0-rc.477",
     "@trpc/react-query": "11.0.0-rc.477",
diff --git a/examples/react/with-trpc/package.json b/examples/react/with-trpc/package.json
index ed933a1fd..8310d367c 100644
--- a/examples/react/with-trpc/package.json
+++ b/examples/react/with-trpc/package.json
@@ -8,8 +8,8 @@
     "start": "vinxi start"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.52.3",
-    "@tanstack/router-devtools": "^1.52.3",
+    "@tanstack/react-router": "^1.52.4",
+    "@tanstack/router-devtools": "^1.52.4",
     "@tanstack/router-plugin": "^1.52.0",
     "@trpc/client": "11.0.0-rc.477",
     "@trpc/server": "11.0.0-rc.477",
diff --git a/packages/react-router-with-query/package.json b/packages/react-router-with-query/package.json
index cc9bf65f7..1d14b9b18 100644
--- a/packages/react-router-with-query/package.json
+++ b/packages/react-router-with-query/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/react-router-with-query",
-  "version": "1.52.3",
+  "version": "1.52.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/react-router/package.json b/packages/react-router/package.json
index 3cb54e854..e2d0fef8b 100644
--- a/packages/react-router/package.json
+++ b/packages/react-router/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/react-router",
-  "version": "1.52.3",
+  "version": "1.52.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/react-router/src/router.ts b/packages/react-router/src/router.ts
index cb07523e9..0de4f86f1 100644
--- a/packages/react-router/src/router.ts
+++ b/packages/react-router/src/router.ts
@@ -1643,11 +1643,6 @@ export class Router<
   load = async (): Promise<void> => {
     this.latestLocation = this.parseLocation(this.latestLocation)
 
-    this.__store.setState((s) => ({
-      ...s,
-      loadedAt: Date.now(),
-    }))
-
     let redirect: ResolvedRedirect | undefined
     let notFound: NotFoundError | undefined
 
@@ -1738,6 +1733,7 @@ export class Router<
                     return {
                       ...s,
                       isLoading: false,
+                      loadedAt: Date.now(),
                       matches: newMatches,
                       pendingMatches: undefined,
                       cachedMatches: [
@@ -1975,12 +1971,38 @@ export class Router<
               const existingMatch = this.getMatch(matchId)!
               const parentMatchId = matches[index - 1]?.id
 
+              const route = this.looseRoutesById[routeId]!
+
+              const pendingMs =
+                route.options.pendingMs ?? this.options.defaultPendingMs
+
+              const shouldPending = !!(
+                onReady &&
+                !this.isServer &&
+                !preload &&
+                (route.options.loader || route.options.beforeLoad) &&
+                typeof pendingMs === 'number' &&
+                pendingMs !== Infinity &&
+                (route.options.pendingComponent ??
+                  this.options.defaultPendingComponent)
+              )
+
               if (
                 // If we are in the middle of a load, either of these will be present
                 // (not to be confused with `loadPromise`, which is always defined)
                 existingMatch.beforeLoadPromise ||
                 existingMatch.loaderPromise
               ) {
+                if (shouldPending) {
+                  setTimeout(() => {
+                    try {
+                      // Update the match and prematurely resolve the loadMatches promise so that
+                      // the pending component can start rendering
+                      triggerOnReady()
+                    } catch {}
+                  }, pendingMs)
+                }
+
                 // Wait for the beforeLoad to resolve before we continue
                 await existingMatch.beforeLoadPromise
               } else {
@@ -1994,23 +2016,8 @@ export class Router<
                     beforeLoadPromise: createControlledPromise<void>(),
                   }))
 
-                  const route = this.looseRoutesById[routeId]!
                   const abortController = new AbortController()
 
-                  const pendingMs =
-                    route.options.pendingMs ?? this.options.defaultPendingMs
-
-                  const shouldPending = !!(
-                    onReady &&
-                    !this.isServer &&
-                    !preload &&
-                    (route.options.loader || route.options.beforeLoad) &&
-                    typeof pendingMs === 'number' &&
-                    pendingMs !== Infinity &&
-                    (route.options.pendingComponent ??
-                      this.options.defaultPendingComponent)
-                  )
-
                   let pendingTimeout: ReturnType<typeof setTimeout>
 
                   if (shouldPending) {
diff --git a/packages/router-arktype-adapter/package.json b/packages/router-arktype-adapter/package.json
index 4177cb19d..377e077cb 100644
--- a/packages/router-arktype-adapter/package.json
+++ b/packages/router-arktype-adapter/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-arktype-adapter",
-  "version": "1.52.3",
+  "version": "1.52.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-devtools/package.json b/packages/router-devtools/package.json
index 7b09bd35c..c03aa5470 100644
--- a/packages/router-devtools/package.json
+++ b/packages/router-devtools/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-devtools",
-  "version": "1.52.3",
+  "version": "1.52.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-valibot-adapter/package.json b/packages/router-valibot-adapter/package.json
index fbf9874f3..91efab3ad 100644
--- a/packages/router-valibot-adapter/package.json
+++ b/packages/router-valibot-adapter/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-valibot-adapter",
-  "version": "1.52.3",
+  "version": "1.52.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-zod-adapter/package.json b/packages/router-zod-adapter/package.json
index 0f9bd1379..5b2d24d31 100644
--- a/packages/router-zod-adapter/package.json
+++ b/packages/router-zod-adapter/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-zod-adapter",
-  "version": "1.52.3",
+  "version": "1.52.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/start/package.json b/packages/start/package.json
index 7f060fcd3..5ba6a0a90 100644
--- a/packages/start/package.json
+++ b/packages/start/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start",
-  "version": "1.52.3",
+  "version": "1.52.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",


Test patch:
diff --git a/packages/react-router/tests/link.test.tsx b/packages/react-router/tests/link.test.tsx
index 9bf54202b..770caac8e 100644
--- a/packages/react-router/tests/link.test.tsx
+++ b/packages/react-router/tests/link.test.tsx
@@ -28,7 +28,7 @@ import {
   useRouterState,
   useSearch,
 } from '../src'
-import { getIntersectionObserverMock } from './utils'
+import { getIntersectionObserverMock, sleep } from './utils'
 
 const ioObserveMock = vi.fn()
 const ioDisconnectMock = vi.fn()
@@ -47,6 +47,8 @@ afterEach(() => {
   cleanup()
 })
 
+const WAIT_TIME = 300
+
 describe('Link', () => {
   test('when using renderHook it returns a hook with same content to prove rerender works', async () => {
     /**
@@ -760,6 +762,77 @@ describe('Link', () => {
     expect(onError).toHaveBeenCalledOnce()
   })
 
+  test('when navigating away from a route with a loader that errors', async () => {
+    const postsOnError = vi.fn()
+    const indexOnError = vi.fn()
+    const rootRoute = createRootRoute({
+      component: () => (
+        <>
+          <div>
+            <Link to="/">Index</Link> <Link to="/posts">Posts</Link>
+          </div>
+          <hr />
+          <Outlet />
+        </>
+      ),
+    })
+    const indexRoute = createRoute({
+      getParentRoute: () => rootRoute,
+      path: '/',
+      component: () => {
+        return (
+          <>
+            <h1>Index</h1>
+          </>
+        )
+      },
+      onError: indexOnError,
+      errorComponent: () => <span>IndexError</span>,
+    })
+
+    const error = new Error('Something went wrong!')
+
+    const postsRoute = createRoute({
+      getParentRoute: () => rootRoute,
+      path: 'posts',
+      loaderDeps: (opts) => ({ page: opts.search }),
+      loader: () => {
+        throw error
+      },
+      onError: postsOnError,
+      errorComponent: () => <span>PostsError</span>,
+      component: () => {
+        return (
+          <>
+            <h1>Posts</h1>
+          </>
+        )
+      },
+    })
+
+    const router = createRouter({
+      routeTree: rootRoute.addChildren([indexRoute, postsRoute]),
+    })
+
+    render(<RouterProvider router={router} />)
+
+    const postsLink = await screen.findByRole('link', { name: 'Posts' })
+
+    fireEvent.click(postsLink)
+
+    const postsErrorText = await screen.findByText('PostsError')
+    expect(postsErrorText).toBeInTheDocument()
+
+    expect(postsOnError).toHaveBeenCalledOnce()
+    expect(postsOnError).toHaveBeenCalledWith(error)
+
+    const indexLink = await screen.findByRole('link', { name: 'Index' })
+    fireEvent.click(indexLink)
+
+    expect(screen.findByText('IndexError')).rejects.toThrow()
+    expect(indexOnError).not.toHaveBeenCalledOnce()
+  })
+
   test('when navigating to /posts with a beforeLoad that redirects', async () => {
     const rootRoute = createRootRoute()
     const indexRoute = createRoute({
@@ -3528,6 +3601,57 @@ describe('Link', () => {
 
     expect(ioObserveMock).not.toBeCalled()
   })
+
+  test('Router.preload="intent", pendingComponent renders during unresolved route loader', async () => {
+    const rootRoute = createRootRoute()
+    const indexRoute = createRoute({
+      getParentRoute: () => rootRoute,
+      path: '/',
+      component: () => {
+        return (
+          <div>
+            <h1>Index page</h1>
+            <Link to="/posts" preload="intent">
+              link to posts
+            </Link>
+          </div>
+        )
+      },
+    })
+
+    const postRoute = createRoute({
+      getParentRoute: () => rootRoute,
+      path: '/posts',
+      loader: () => sleep(WAIT_TIME),
+      component: () => <div>Posts page</div>,
+    })
+
+    const routeTree = rootRoute.addChildren([postRoute, indexRoute])
+    const router = createRouter({
+      routeTree,
+      defaultPreload: 'intent',
+      defaultPendingMs: 200,
+      defaultPendingComponent: () => <p>Loading...</p>,
+    })
+
+    render(<RouterProvider router={router} />)
+
+    const linkToPosts = await screen.findByRole('link', {
+      name: 'link to posts',
+    })
+    expect(linkToPosts).toBeInTheDocument()
+
+    fireEvent.focus(linkToPosts)
+    fireEvent.click(linkToPosts)
+
+    const loadingElement = await screen.findByText('Loading...')
+    expect(loadingElement).toBeInTheDocument()
+
+    const postsElement = await screen.findByText('Posts page')
+    expect(postsElement).toBeInTheDocument()
+
+    expect(window.location.pathname).toBe('/posts')
+  })
 })
 
 describe('createLink', () => {