Skip to main content

react.usechain

Home > @openformat/react > useChain

useChain() function

Hook to get the wallet state

Signature:

export declare function useChain(): {
network: Chain | undefined;
chainId: number | undefined;
};

Returns:

{ network: Chain | undefined; chainId: number | undefined; }

Example

const { network, chainId } = useChain();