Steps to reproduce:
- Use
useSendUserOperation hook.
- Inspect
result.data in a branch where result.isSuccess is true.
Expected: based on original react-query types, when isSuccess is true, data should have TData type.
Observed: data is TData | undefined.
Same issue applies to isError and error.
Quick triage suggests original types get mangled by Omit<UseMutationResult<…>, 'mutate'>. Wagmi seems to use a custom UnionOmit utility type to deal with the same problem.
Steps to reproduce:
useSendUserOperationhook.result.datain a branch whereresult.isSuccessis true.Expected: based on original react-query types, when
isSuccessis true,datashould haveTDatatype.Observed:
dataisTData | undefined.Same issue applies to
isErroranderror.Quick triage suggests original types get mangled by
Omit<UseMutationResult<…>, 'mutate'>. Wagmi seems to use a customUnionOmitutility type to deal with the same problem.