useContractRead throws InvalidAddressError #43
Replies: 6 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Is there other way to load the lib without |
Beta Was this translation helpful? Give feedback.
-
@ernaneluis no way. use |
Beta Was this translation helpful? Give feedback.
-
@ernaneluis |
Beta Was this translation helpful? Give feedback.
-
Because Im trying to add a conditional to the hook of And the code is inside <script setup> PS2: Also inside of a watch the hooks breaks with the |
Beta Was this translation helpful? Give feedback.
-
@ernaneluis Unfortunately I don't understand what you're trying to do Can you provide an example Hope that gives you some advice |
Beta Was this translation helpful? Give feedback.
-
I see that
useBalance
accept null address as arg and does not throw any error. HoweveruseContractRead
does not follow same pattern. This way when user is not connected the address is null and try to call the hookuseContractRead
using an null address will throw the error. Then trying to add a conditional to the this hook also throws another error:How could solve this?
Example 1: Throws
InvalidAddressError: Address "null" is invalid.
Example 2: Throws
Uncaught (in promise) Error: useConfig must be used within UseWagmiPlugin
Beta Was this translation helpful? Give feedback.
All reactions