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