-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
Hello! Thanks to those who contributed the TypeScript definitions, they're very useful. I did run into what looks like a problem with the PromiseStateMapping and FunctionMapping definitions. They look like:
type PromiseStateMapping<
TProps,
TProp extends keyof TProps
> = TProps[TProp] extends PromiseState<infer TValue>
? string | Mapping<TProps, TValue>
: never;
// Function
type FunctionMapping<
TProps,
TProp extends keyof TProps
> = TProps[TProp] extends ((...args: infer TArgs) => void)
? ((...args: TArgs) => PropsMap<TProps>)
: never;The two types
TProps[TProp] extends PromiseState<infer TValue>and
TProps[TProp] extends ((...args: infer TArgs) => void)appear to need an | undefined appended to them. Without this, I get (at least with TypeScript 3.3.3) type errors with connect() whenever the refetch props of the component are declared as optional with ?. But all refetch props need to be declared optional, since otherwise users of the component would have to pass them in. Does this sound right or am I missing something?
Metadata
Metadata
Assignees
Labels
No labels