Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return type of useSendUserOperation is inconsistent with useMutation return type #6

Open
freeatnet opened this issue Apr 22, 2024 · 0 comments

Comments

@freeatnet
Copy link

Steps to reproduce:

  1. Use useSendUserOperation hook.
  2. 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.

@freeatnet freeatnet changed the title Return type of useSendUserOperation is inconsistent with react-query pattern Return type of useSendUserOperation is inconsistent with useMutation return type Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant