useSetPrimaryName
Sets the signer's primary name. Signature, options, result and examples for useSetPrimaryName in @ensforge/react. Includes examples.
Write hookstable
Since v1.0.0View source
Sets the signer's primary name. Preset of useWrite(Actions.primaryName.set).
It wraps primaryName.set: the same options, result and errors.
Signature
function useSetPrimaryName(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.primaryName.set>[1], Actions.primaryName.set.ReturnType, Actions.primaryName.set.ErrorType >Examples
import { useSetPrimaryName } from "@ensforge/react"
function Send() {
const { mutate, isPending } = useSetPrimaryName()
return <button disabled={isPending} onClick={() => mutate({ name: "alice.eth" })}>Send</button>
}See also
- The hook types:
ReadResult,WriteResultandReadConfig.
Was this page helpful?