Expected 1 arguments, but got 0.(2554)
index.tsx(7, 25): An argument for 'args' was not provided.
Since (args: RouteDataArgs<typeof routeData>) => (() => undefined) | (() => string) does not extend RouteDataFunc<unknown, unknown>, the type is not ReturnType<T> but T.
This change makes it so that that case is properly handled and typed. I avoided using any but the change would otherwise be equivalent to:
data: T extends RouteDataFunc<any> ? ReturnType<T> : T;
Using
RouteDataFunc
without specifying any generic types results inRouteDataFunc<unknown, unknown>
, whichRouteDataFunc<NotUnknown, unknown>
does not extend. See https://stackblitz.com/edit/solid-ssr-vite-pcbdkr?file=tsconfig.json,src%2Froutes%2Findex.tsx:Since
(args: RouteDataArgs<typeof routeData>) => (() => undefined) | (() => string)
does not extendRouteDataFunc<unknown, unknown>
, the type is notReturnType<T>
butT
.This change makes it so that that case is properly handled and typed. I avoided using
any
but the change would otherwise be equivalent to: