Skip to main content

useNetworkSwitch

Use this hook to switch between configured networks.

const { switchNetwork } = useNetworkSwitch();

Usage

import { useNetworkSwitch } from "~~/hooks/eth-mobile";

function NetworkSwitcher() {
const { switchNetwork } = useNetworkSwitch();

return <Button onPress={switchNetwork}>Switch Network</Button>;
}

Return Values

  • The switchNetwork function lists configured networks to switch to.