usePolkadotClient
Props
Name
Type
Description
Return Type
Name
Type
Description
Basic Usage
import { usePolkadotClient } from 'typink';
function ChainInfo() {
const { client, status, network } = usePolkadotClient();
if (status === 'Connecting') return <div>Connecting...</div>;
if (status === 'NotConnected') return <div>Not connected</div>;
return (
<div>
<p>Network: {network.name}</p>
<p>Symbol: {network.symbol}</p>
<p>Connected: {status === 'Connected' ? 'Yes' : 'No'}</p>
</div>
);
}Last updated