Skip to content

Commit aeb1637

Browse files
committed
Merge branch 'dev' into markdalgleish/fix-rsc-dev-fouc
2 parents 7382c84 + f8b9575 commit aeb1637

32 files changed

+1480
-211
lines changed

.changeset/cold-geese-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Properly escape interpolated param values in `generatePath()`

.changeset/fresh-pugs-relax.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Maintain `ReadonlyMap` and `ReadonlySet` types in server response data.

.changeset/quiet-cows-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Delay serialization of `.data` redirects to 202 responses until after middleware chain

.changeset/real-rules-compare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Fix `TypeError` if you throw from `patchRoutesOnNavigation` when no partial matches exist

.changeset/rotten-parents-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
fix: memory leak in default entry.server

.changeset/tender-sheep-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Fix `basename` usage without a leading slash in data routers

contributors.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- BDomzalski
5353
- bhbs
5454
- bilalk711
55+
- bjohn465
5556
- bmsuseluda
5657
- bobziroll
5758
- bravo-kernel
@@ -274,6 +275,7 @@
274275
- mtendekuyokwa19
275276
- mtliendo
276277
- namoscato
278+
- nanianlisao
277279
- ned-park
278280
- nenene3
279281
- ngbrown

docs/api/data-routers/RouterProvider.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ implementation. You _almost always_ want to use the version from
4848
function RouterProvider({
4949
router,
5050
flushSync: reactDomFlushSyncImpl,
51+
unstable_onError,
5152
}: RouterProviderProps): React.ReactElement
5253
```
5354

@@ -63,6 +64,24 @@ You usually don't have to worry about this:
6364
- If you are rendering in a non-DOM environment, you can import
6465
`RouterProvider` from `react-router` and ignore this prop
6566

67+
### unstable_onError
68+
69+
An error handler function that will be called for any loader/action/render
70+
errors that are encountered in your application. This is useful for
71+
logging or reporting errors instead of the `ErrorBoundary` because it's not
72+
subject to re-rendering and will only run one time per error.
73+
74+
The `errorInfo` parameter is passed along from
75+
[`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
76+
and is only present for render errors.
77+
78+
```tsx
79+
<RouterProvider unstable_onError=(error, errorInfo) => {
80+
console.error(error, errorInfo);
81+
reportToErrorService(error, errorInfo);
82+
}} />
83+
```
84+
6685
### router
6786

6887
The [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html) instance to use for navigation and data fetching.

docs/api/framework-routers/HydratedRouter.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,21 @@ available to
3838
[`clientAction`](../../start/framework/route-module#clientAction)/[`clientLoader`](../../start/framework/route-module#clientLoader)
3939
functions
4040

41+
### unstable_onError
42+
43+
An error handler function that will be called for any loader/action/render
44+
errors that are encountered in your application. This is useful for
45+
logging or reporting errors instead of the `ErrorBoundary` because it's not
46+
subject to re-rendering and will only run one time per error.
47+
48+
The `errorInfo` parameter is passed along from
49+
[`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
50+
and is only present for render errors.
51+
52+
```tsx
53+
<HydratedRouter unstable_onError={(error, errorInfo) => {
54+
console.error(error, errorInfo);
55+
reportToErrorService(error, errorInfo);
56+
}} />
57+
```
58+

0 commit comments

Comments
 (0)