# Function useRouteError

- useRouteError(): unknown

- Returns the nearest ancestor Route error, which could be a loader/action error or a render error. This is intended to be called from your ErrorBoundary/errorElement to display a proper error message.

  #### Returns unknown

  - Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/hooks.d.ts:165