diff --git a/packages/react-router-dev/vite/with-props.ts b/packages/react-router-dev/vite/with-props.ts index b66ce8060e..1c85d10a77 100644 --- a/packages/react-router-dev/vite/with-props.ts +++ b/packages/react-router-dev/vite/with-props.ts @@ -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() { @@ -48,6 +48,7 @@ export const plugin: Plugin = { params: useParams(), loaderData: useLoaderData(), actionData: useActionData(), + error: useRouteError(), }; return h(ErrorBoundary, props); };