Skip to content

Commit 1a8265c

Browse files
committed
Merge branch 'main' into release-next
2 parents 19af0cf + a23f017 commit 1a8265c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

contributors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
- senseibarni
198198
- sergiodxa
199199
- sgalhs
200+
- sgrishchenko
200201
- shamsup
201202
- shihanng
202203
- shivamsinghchahar
@@ -238,7 +239,6 @@
238239
- xavier-lc
239240
- xcsnowcity
240241
- yionr
241-
- yuleicul
242242
- yracnet
243+
- yuleicul
243244
- zheng-chuang
244-
- sgrishchenko

docs/route/should-revalidate.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface ShouldRevalidateFunctionArgs {
3131

3232
</details>
3333

34-
This function allows you opt-out of revalidation for a route's loader as an optimization.
34+
This function allows you opt-out of revalidation for a route's [loader][loader] as an optimization.
3535

3636
<docs-warning>This feature only works if using a data router, see [Picking a Router][pickingarouter]</docs-warning>
3737

@@ -41,12 +41,17 @@ There are several instances where data is revalidated, keeping your UI in sync w
4141
- After an [`action`][action] is called from a [`<fetcher.Form>`][fetcher]
4242
- After an [`action`][action] is called from [`useSubmit`][usesubmit]
4343
- After an [`action`][action] is called from a [`fetcher.submit`][fetcher]
44+
- When an explicit revalidation is triggered via [`useRevalidator`][userevalidator]
4445
- When the [URL params][params] change for an already rendered route
4546
- When the URL Search params change
4647
- When navigating to the same URL as the current URL
4748

4849
If you define `shouldRevalidate` on a route, it will first check the function before calling the route loader for new data. If the function returns `false`, then the loader _will not_ be called and the existing data for that loader will persist on the page.
4950

51+
<docs-info>
52+
Fetcher loads also revalidate, but because they load a specific URL, they don't have to worry about the URL-driven revalidation scenarios above. Fetcher loads only revalidate by default after action submissions and explicit revalidation requests.
53+
</docs-info>
54+
5055
```jsx lines=[5-9,14-15,21-22]
5156
<Route
5257
path="meals-plans"
@@ -84,6 +89,6 @@ Note that this is only for data that has already been loaded, is currently rende
8489
[fetcher]: ../hooks/use-fetcher
8590
[usesubmit]: ../hooks/use-submit
8691
[loader]: ./loader
87-
[useloaderdata]: ../hooks/use-loader-data
8892
[params]: ./route#dynamic-segments
8993
[pickingarouter]: ../routers/picking-a-router
94+
[userevalidator]: ../hooks/use-revalidator

0 commit comments

Comments
 (0)