Skip to content
Source
Sign inSign up
TanStack/router

fix(router): context issues #1907

Mergedtannerlinsleymerged 41 commits intomain fromrefs/pull/1907/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 32 changed files with 30 additions and 8 deletions (loading 29).

x
0 of 32 viewed, 32 left
26 additions and 2 deletionsdocs/framework/react/guide/data-loading.mdModified
View file
@@ -452,7 +452,7 @@
```
​
-The `reset` function can be used to show a `retry` button. If you want to retry the route loading, you need to additionally call `router.invalidate()`:
+The `reset` function can be used to allow the user to retry rendering the error boundaries normal children:
​
```tsx
// routes/posts.tsx
@@ -468,7 +468,31 @@
onClick={() => {
// Reset the router error boundary
reset()
- // Invalidate the route to reload the loader
+ }}
+ >
+ retry
+ </button>
+ </div>
+ )
+ },
+})
+```
+​
+If the error was the result of a route load, you should instead call `router.invalidate()`, which will coordinate both a router reload and an error boundary reset: