Skip to content

Commit 8dcdd14

Browse files
add section about using revalidate together with redirect (#1240)
Co-authored-by: Sarah <gerrardsarah@gmail.com> Co-authored-by: Sarah Gerrard <98355961+LadyBluenotes@users.noreply.github.com>
1 parent 1506e0f commit 8dcdd14

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"prettier-plugin-tailwindcss": "^0.6.14",
5858
"tailwindcss": "^3.4.17",
5959
"typescript": "^5.9.2",
60-
"typescript-eslint": "8.41.0",
60+
"typescript-eslint": "^8.41.0",
6161
"vite": "^6.3.5"
6262
},
6363
"engines": {

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/solid-router/reference/response-helpers/redirect.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,13 @@ function redirect(url: string, init?: number | RouterResponseInit): CustomRespon
7272
```
7373

7474
The `RouterResponseInit` type extends the native [`ResponseInit`](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#options) interface.
75+
76+
## Revalidate Query Keys
77+
78+
You can pass query keys to the redirect helper to revalidate them.
79+
80+
```ts
81+
redirect("/", { revalidate: ["getUser", getUser.keyFor(id)] });
82+
```
83+
84+
This will only invalidate the query keys passed to the redirect helper instead of the entire next page.

0 commit comments

Comments
 (0)