Skip to content

Commit 9272911

Browse files
authored
fix: pass route error to errorboundary as a prop (#12338)
1 parent d0ac7ba commit 9272911

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-router-dev/vite/with-props.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const plugin: Plugin = {
1919
if (id !== VirtualModule.resolve(vmodId)) return;
2020
return dedent`
2121
import { createElement as h } from "react";
22-
import { useActionData, useLoaderData, useMatches, useParams } from "react-router";
22+
import { useActionData, useLoaderData, useMatches, useParams, useRouteError } from "react-router";
2323
2424
export function withComponentProps(Component) {
2525
return function Wrapped() {
@@ -48,6 +48,7 @@ export const plugin: Plugin = {
4848
params: useParams(),
4949
loaderData: useLoaderData(),
5050
actionData: useActionData(),
51+
error: useRouteError(),
5152
};
5253
return h(ErrorBoundary, props);
5354
};

0 commit comments

Comments
 (0)