useNetworkMismatch

Hook for checking whether the connected wallet is currently on the correct chain, i.e. the chain specified in the activeChain on the ThirdwebProvider .

Example

import { useNetworkMismatch } from "@thirdweb-dev/react";
const App = () => {
const isMismatched = useNetworkMismatch();
};

Using this value, you can prompt users to switch their network using the useSwitchChain hook.

Returns

Returns true if the chainId of the connected wallet is different from the chainId of the activeChain on the ThirdwebProvider component