You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Higher-order functions, like .map, don't carry type semantics very well. The best we can do in this case is by helping out the compiler a bit more asserting const in a few more places so result is now inferred as string | number.
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.
Is there an existing issue for this?
Package Version
1.0.2
Current Behavior
Hey guys,
I'm upgrading to wagmi v1 but I'm having issues with type inference when using useContractReads (it works fine with wagmi <v1).
Here's a simple example that is no longer working:
The result is of type
unknown
:Most of the useContractReads no longer inferring the data type correctly, although there is a few of them that still works.
Let me know if you have any clue why this is happening.
Thank you very much
Expected Behavior
No response
Steps To Reproduce
No response
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
https://stackblitz.com/edit/new-wagmi-xemvdq?file=src/App.tsx
Anything else?
No response
The text was updated successfully, but these errors were encountered: