Proper pattern for enabled:false on useContractRead #1307
Unanswered
0xCardinalError
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You have two options:
const { data, refetch } = useContractRead({ … })
<button onClick={refetch}>Fetch data</button>
const [enabled, setEnabled] = React.useState(false)
const { data } = useContractRead({ …, enabled })
<button onClick={() => setEnabled(true)}>Fetch data</button> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Have put enabled:false on my useContractRead so when I actually want to call this hook how should we do it?
Probably calling .refetch(); ?
Beta Was this translation helpful? Give feedback.
All reactions