Hook for accessing the chain ID of the network the current wallet is connected to
import { useChainId } from "@thirdweb-dev/react" Copy
import { useChainId } from "@thirdweb-dev/react"
You can get the chain ID of the connected wallet by using the hook as follows:
import { useChainId } from "@thirdweb-dev/react"const App = () => { const chainId = useChainId() return <div>{chainId}</div>} Copy
import { useChainId } from "@thirdweb-dev/react"const App = () => { const chainId = useChainId() return <div>{chainId}</div>}
Documentation
Generated using TypeDoc
Hook for accessing the chain ID of the network the current wallet is connected to