Skip to content

Commit

Permalink
update useEffect dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
trkaplan committed May 15, 2022
1 parent f5a0775 commit b986cd8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hooks/contractHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ export const useContractLoader = <

const contract = useMemo(
() => attachContract<F, C>(factory, address, web3Provider) || undefined,
[factory, address, web3Provider],
[address, web3Provider],
);
const [values, setValues] = useState<ContractValues<C, K>>();

useEffect(() => {
// noinspection JSIgnoredPromiseFromCall
fetchValues();
}, [address]);
}, [contract]);

const fetchValues = async () => {
if (!contract) {
Expand Down Expand Up @@ -77,7 +77,7 @@ export const useInterfaceLoader = <C extends Contract, K extends KeyOfGetterFunc
useEffect(() => {
// noinspection JSIgnoredPromiseFromCall
fetchValues();
}, [address]);
}, [contract]);

const fetchValues = async () => {
if (!contract) {
Expand Down

0 comments on commit b986cd8

Please sign in to comment.