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

usePrimaryName

Reads the primary name of an address, verified against its forward address. Signature, options, result and examples for usePrimaryName in @ensforge/react.

Read hookstable
Since v1.0.0View source

Reads the primary name of an address, verified against its forward address. Preset of useRead(Actions.primaryName.get, …).

It wraps primaryName.get: the same options, result and errors.

Signature

function usePrimaryName(options: Actions.primaryName.get.Options | undefined, config?: ReadConfig): ReadResult<Actions.primaryName.get.ReturnType, Actions.primaryName.get.ErrorType>

Examples

Reading in a component
import { usePrimaryName } from "@ensforge/react"

function View() {
  const { data: primary } = usePrimaryName({ address })
  return <span>{primary}</span>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?