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
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,WriteResultandReadConfig.
Was this page helpful?