useConnect
Re-exported wagmi hook for connecting an EOA. This hook uses the internal wagmi config though so that the state is in sync with the rest of the Alchemy Account hook state. Useful if you wnat to connect to an EOA.
Import
import { useConnect } from "@account-kit/react";
Usage
import { useConnect } from "@account-kit/react";
const { connectors, connect } = useConnect({
// these are optional
onSuccess: () => {
// do something on success
},
onError: (error) => console.error(error),
});
Parameters
params
UseMutationParameters
mutation parameters to use for the connect mutation
Returns
UseConnectReturnType
the wagmi useConnect return type