regexparam
regexparam copied to clipboard
RouteParams for route with both required and multiple optional parameters gives incorrect typing
With RouteParams<'/leagues/:routeId/:slugStr?/:subPage?'> the inferred types seem to parse the route incorrectly.
Expected:
{
routeId: string;
slugStr?: string | undefined;
subPage?: string | undefined;
}
Actual:
{
"routeId/slugStr"?: string | undefined;
subPage?: string | undefined;
}
This is TS 5.6.2 if that makes a difference