Switch to blockchain with given chain id in the active wallet.
import { useSwitchActiveWalletChain } from "thirdweb/react";import { sepolia } from "thirdweb/chains"; const switchChain = useSwitchActiveWalletChain(); // later in your code<button onClick={() => switchChain(sepolia)}>Switch Chain</button>;
function useSwitchActiveWalletChain(): ( chain: Readonly<ChainOptions & { rpc: string }>,) => Promise<void>;
let returnType: ( chain: Readonly<ChainOptions & { rpc: string }>,) => Promise<void>;
A function to switch to blockchain with given chain id in the active wallet.