Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Skip to Content
ensforgeReact

useMigrate

Moves names from ENSv1 to ENSv2. Signature, options, result and examples for useMigrate in @ensforge/react. Signature, result and examples for useMigrate.

Write hookstable
Since v1.0.0View source

Moves names from ENSv1 to ENSv2. Preset of useWrite(Actions.migration.migrate).

It wraps migration.migrate: the same options, result and errors.

Signature

function useMigrate(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.migration.migrate>[1], Actions.migration.migrate.ReturnType, Actions.migration.migrate.ErrorType >

Examples

A button that sends it
import { useMigrate } from "@ensforge/react"

function Send() {
  const { mutate, isPending } = useMigrate()
  return <button disabled={isPending} onClick={() => mutate({ names: "alice.eth" })}>Send</button>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?