Releases: coinbase/onchainkit
Releases · coinbase/onchainkit
v0.10.1
v0.10.0
Minor Changes
-
4090f4f: - feat: Replace internal
useOnchainActionWithCache
withtanstack/react-query
. This affectsuseName
anduseAvatar
hooks. The return type and the input parameters also changed for these 2 hooks.BREAKING CHANGES
The input parameters as well as return types of
useName
anduseAvatar
hooks have changed. The return type ofuseName
anduseAvatar
hooks changed.useName
Before
import { useName } from "@coinbase/onchainkit/identity"; const { ensName, isLoading } = useName("0x1234");
After
import { useName } from "@coinbase/onchainkit/identity"; // Return type signature is following @tanstack/react-query useQuery hook signature const { data: name, isLoading, isError, error, status, } = useName( { address: "0x1234" }, { enabled: true, cacheTime: 1000 * 60 * 60 * 24 }, );
useAvatar
Before
import { useAvatar } from "@coinbase/onchainkit/identity"; const { ensAvatar, isLoading } = useAvatar("vitalik.eth");
After
import { useAvatar } from "@coinbase/onchainkit/identity"; // Return type signature is following @tanstack/react-query useQuery hook signature const { data: avatar, isLoading, isError, error, status, } = useAvatar( { ensName: "vitalik.eth" }, { enabled: true, cacheTime: 1000 * 60 * 60 * 24 }, );