Skip to content

Commit 9e8b343

Browse files
committed
Clarify docs on shouldRevalidate behavior in SPA Mode
1 parent 2df250e commit 9e8b343

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/start/framework/route-module.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ The meta of the last matching route is used, allowing you to override parent rou
482482

483483
## `shouldRevalidate`
484484

485-
In framework mode, route loaders are automatically revalidated after all navigations and form submissions (this is different from [Data Mode](../data/route-object#shouldrevalidate)). This enables middleware and loaders to share a request context and optimize in different ways than then they would be in Data Mode.
485+
In framework mode with SSR, route loaders are automatically revalidated after all navigations and form submissions (this is different from [Data Mode][data-mode-should-revalidate]). This enables middleware and loaders to share a request context and optimize in different ways than then they would be in Data Mode.
486486

487487
Defining this function allows you to opt out of revalidation for a route loader for navigations and form submissions.
488488

@@ -496,6 +496,8 @@ export function shouldRevalidate(
496496
}
497497
```
498498

499+
When using [SPA Mode][spa-mode], there are no server loaders to call on navigations, so `shouldRevalidate` behaves the same as it does in [Data Mode][data-mode-should-revalidate].
500+
499501
[`ShouldRevalidateFunctionArgs` Reference Documentation ↗](https://api.reactrouter.com/v7/interfaces/react_router.ShouldRevalidateFunctionArgs.html)
500502

501503
---
@@ -517,3 +519,5 @@ Next: [Rendering Strategies](./rendering)
517519
[meta-element]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
518520
[meta-params]: https://api.reactrouter.com/v7/interfaces/react_router.MetaArgs
519521
[meta-function]: https://api.reactrouter.com/v7/types/react_router.MetaDescriptor.html
522+
[data-mode-should-revalidate]: ../data/route-object#shouldrevalidate
523+
[spa-mode]: ../../how-to/spa

0 commit comments

Comments
 (0)