Skip to content

Commit

Permalink
fix: pass route error to errorboundary as a prop (#12338)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori authored Nov 21, 2024
1 parent d0ac7ba commit 9272911
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-router-dev/vite/with-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const plugin: Plugin = {
if (id !== VirtualModule.resolve(vmodId)) return;
return dedent`
import { createElement as h } from "react";
import { useActionData, useLoaderData, useMatches, useParams } from "react-router";
import { useActionData, useLoaderData, useMatches, useParams, useRouteError } from "react-router";
export function withComponentProps(Component) {
return function Wrapped() {
Expand Down Expand Up @@ -48,6 +48,7 @@ export const plugin: Plugin = {
params: useParams(),
loaderData: useLoaderData(),
actionData: useActionData(),
error: useRouteError(),
};
return h(ErrorBoundary, props);
};
Expand Down

0 comments on commit 9272911

Please sign in to comment.