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?
Hello! Thanks to those who contributed the TypeScript definitions, they're very useful. I did run into what looks like a problem with the
PromiseStateMappingandFunctionMappingdefinitions. They look like:The two types
and
appear to need an
| undefinedappended to them. Without this, I get (at least with TypeScript 3.3.3) type errors withconnect()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?