useBlockNumber

Hook that watches for changes in the block number on a given chain.

Example

import { useBlockNumber } from "thirdweb/react";
const blockNumber = useBlockNumber({ client, chain });
function useBlockNumber(
): undefined | bigint;

Parameters

The options for the hook.

Type

let options: {
chain: Chain;
client: ThirdwebClient;
enabled?: boolean;
watch?: boolean;
};

Returns

let returnType: undefined | bigint;

The latest block number.