-
I am using the const [{ data: feeData, error: feeError, loading: feeLoading }, getFeeData] =
useFeeData({ formatUnits: 'gwei', skip: true });
useEffect(async () => {
// this always returns eth mainnet gas price when the component first mounts
await getFeeData();
}, []);
useInterval(
async () => {
// this is an interval that runs every 10 seconds to update the fee data and it actually does return the current network's gas price
await getFeeData();
},
accountAddress ? 10000 : null
); |
Beta Was this translation helpful? Give feedback.
Answered by
lsbyerley
Feb 1, 2022
Replies: 1 comment 1 reply
-
It appears using the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lsbyerley
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears using the
watch: true
flag for the useFeeData hook resolves this.. apologies for not seeing that option farther down in the docs