Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

useConnect

Usage

import { useConnect } from '@ivem/kit-react'
 
const connect = useConnect()
await connect.mutateAsync()

Parameters

  • parameters.config?: Config
  • parameters.mutation?: Omit<UseMutationOptions<...>, "mutationFn">

Return Type

  • mutate(params?, options?) => void
  • mutateAsync(params?) => Promise<{ accounts: readonly string[]; chainId: string }>
  • isPending: boolean
  • error: Error | null

Examples

function ConnectButton() {
  const connect = useConnect()
  return <button disabled={connect.isPending} onClick={() => connect.mutate()}>Connect</button>
}

Related