useAutoConnect

Autoconnect the last previously connected wallet.

Example

import { useAutoConnect } from "thirdweb/react";
const { data: autoConnected, isLoading } = useAutoConnect({
client,
accountAbstraction,
wallets,
onConnect,
timeout,
});
function useAutoConnect(
): UseQueryResult<boolean, Error>;

Parameters

The props for auto connect.

Type

let props: {
accountAbstraction?: SmartWalletOptions;
appMetadata?: AppMetadata;
chain?: Chain;
client: ThirdwebClient;
onConnect?: (wallet: Wallet) => void;
timeout?: number;
wallets?: Array<Wallet>;
};

Returns

let returnType: UseQueryResult<boolean, Error>;

whether the auto connect was successful.