diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index e4db8e1033..c9045a21d4 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -357,7 +357,7 @@ export function createRouteRef< }, ParamKey extends string = never, >(config: { - id?: string; + id: string; params?: ParamKey[]; }): RouteRef>; diff --git a/packages/core-plugin-api/src/routing/RouteRef.ts b/packages/core-plugin-api/src/routing/RouteRef.ts index 7a4b228fab..36ca3f073d 100644 --- a/packages/core-plugin-api/src/routing/RouteRef.ts +++ b/packages/core-plugin-api/src/routing/RouteRef.ts @@ -62,16 +62,12 @@ export function createRouteRef< ParamKey extends string = never, >(config: { /** The id of the route ref, used to identify it when printed */ - id?: string; + id: string; /** A list of parameter names that the path that this route ref is bound to must contain */ params?: ParamKey[]; }): RouteRef> { - const id = config.id; - if (!id) { - throw new Error('RouteRef must be provided a non-empty id'); - } return new RouteRefImpl( - id, + config.id, (config.params ?? []) as ParamKeys>, ); }