Docs

createContractQuery

Creates a useQuery hook for a contract call.

Example

import { createContractQuery } from "thirdweb/react";
import { totalSupply } from "thirdweb/extensions/erc20";
const useTotalSupply = createContractQuery(totalSupply);
const { data, isLoading } = useTotalSupply({ contract });

Parameters

Returns

An object containing the created useRead hook.