diff --git a/.changeset/error-response-type.md b/.changeset/error-response-type.md index 9ae4c5e438..6218825360 100644 --- a/.changeset/error-response-type.md +++ b/.changeset/error-response-type.md @@ -6,4 +6,4 @@ "@remix-run/router": patch --- -Move the `@private` class export `ErrorResponse` to an `UNSAFE_ErrorResponse` export since it is an implementation detail and there should be no construction of `ErrorResponse` instances in userland. This frees us up to export a `type ErrorResponse` which correlates to an instance of the class via `InstanceType`. Userland code should only ever be using `ErrorResponse` as a type and should be type-narrowing via `isRouteErrorResponse`. +Move the `@private` class export `ErrorResponse` to an `UNSAFE_ErrorResponseImpl` export since it is an implementation detail and there should be no construction of `ErrorResponse` instances in userland. This frees us up to export a `type ErrorResponse` which correlates to an instance of the class via `InstanceType`. Userland code should only ever be using `ErrorResponse` as a type and should be type-narrowing via `isRouteErrorResponse`. diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index 65274879ec..10ad7887cf 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -49,7 +49,7 @@ import { createHashHistory, joinPaths, stripBasename, - UNSAFE_ErrorResponse as ErrorResponseImpl, + UNSAFE_ErrorResponseImpl as ErrorResponseImpl, UNSAFE_invariant as invariant, UNSAFE_warning as warning, } from "@remix-run/router"; diff --git a/packages/router/index.ts b/packages/router/index.ts index 4210aadfab..d67784437d 100644 --- a/packages/router/index.ts +++ b/packages/router/index.ts @@ -82,7 +82,7 @@ export * from "./router"; export type { RouteManifest as UNSAFE_RouteManifest } from "./utils"; export { DeferredData as UNSAFE_DeferredData, - ErrorResponseImpl as UNSAFE_ErrorResponse, + ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, } from "./utils";