Skip to main content

useSplit() function

Warning: This API is now obsolete.

This hook is deprecated and will be removed in a future major version. You should use instead.

- const split = useSplit("0x1234...");
+ const split = useContract("0x1234...", "split").contract;

Hook for getting an instance of a Split contract. This contract supports fund distribution to multiple parties.

Example

import { useContract } from '@thirdweb-dev/react'

export default function Component() {
const { contract } = useContract("<YOUR-CONTRACT-ADDRESS>", "split")

// Now you can use the split contract in the rest of the component

// For example, this function will retrun all the receipients of the split
async function getRecipients() {
const recipients = await contract.getAllRecipients()
return recipients
}

...
}

Signature:

export declare function useSplit(
contractAddress: RequiredParam<string>,
): import("@thirdweb-dev/sdk").Split | undefined;

Parameters

ParameterTypeDescription
contractAddressRequiredParam<string>the address of the Split contract, found in your thirdweb dashboard

Returns:

import("@thirdweb-dev/sdk").Split | undefined