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

1import { useConnect } from "@account-kit/react";

Usage

1import { useConnect } from "@account-kit/react";
2
3const { connectors, connect } = useConnect({
4 // these are optional
5 onSuccess: () => {
6 // do something on success
7 },
8 onError: (error) => console.error(error),
9});

Parameters

params

UseMutationParameters mutation parameters to use for the connect mutation

Returns

UseConnectReturnType the wagmi useConnect return type