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

useCreateSubname

Creates a subname, optionally with records. Signature, options, result and examples for useCreateSubname in @ensforge/react.

Write hookstable
Since v1.0.0View source

Creates a subname, optionally with records. Preset of useWrite(Actions.subname.create).

It wraps subname.create: the same options, result and errors.

Signature

function useCreateSubname(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.subname.create>[1], Actions.subname.create.ReturnType, Actions.subname.create.ErrorType >

Examples

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

function Send() {
  const { mutate, isPending } = useCreateSubname()
  return <button disabled={isPending} onClick={() => mutate({ name: "pay.alice.eth", owner: recipient })}>Send</button>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?