useContractEvents

Hook for reading events emitted by a smart contract, including new events as they are emitted (optional).

By default, it reads all events emitted by the smart contract.

Example

import { useContractEvents, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useContractEvents(contract);
}

Parameters

Returns

The hook's data property, once loaded, contains an array of ContractEvent objects