From 72d66aace98e8437b21c4fef84a376aab27bb759 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 1 Sep 2021 05:53:57 -0300 Subject: [PATCH] Fix infinite refresh --- src/usePriceOracle.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/usePriceOracle.ts b/src/usePriceOracle.ts index 0fc909a..f41a1be 100644 --- a/src/usePriceOracle.ts +++ b/src/usePriceOracle.ts @@ -8,7 +8,8 @@ export const useETHUSDOracle = ( provider: JsonRpcProvider | undefined, blockTag: BlockTag | undefined ) => { - const priceMap = useMultipleETHUSDOracle(provider, [blockTag]); + const blockTags = useMemo(() => [blockTag], [blockTag]); + const priceMap = useMultipleETHUSDOracle(provider, blockTags); if (blockTag === undefined) { return undefined;