Repository navigation
useContractRead throws InvalidAddressError #43
Replies: 6 comments 3 replies
|
Is there other way to load the lib without |
|
@ernaneluis no way. use |
|
@ernaneluis |
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 |
|
@ernaneluis Unfortunately I don't understand what you're trying to do Can you provide an example Hope that gives you some advice |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I see that
useBalanceaccept null address as arg and does not throw any error. HoweveruseContractReaddoes not follow same pattern. This way when user is not connected the address is null and try to call the hookuseContractReadusing 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 UseWagmiPluginAll reactions