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

useAvatar

Reads a name's avatar as an image URL, with NFT avatars resolved. Signature, options, result and examples for useAvatar in @ensforge/react.

Read hookstable
Since v1.0.0View source

Reads a name's avatar as an image URL, with NFT avatars resolved. Preset of useRead(Actions.record.getAvatar, …).

It wraps record.getAvatar: the same options, result and errors.

Signature

function useAvatar(options: Actions.record.getAvatar.Options | undefined, config?: ReadConfig): ReadResult<Actions.record.getAvatar.ReturnType, Actions.record.getAvatar.ErrorType>

Examples

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

function View() {
  const { data: avatar } = useAvatar({ name: "nick.eth" })
  return <img src={avatar ?? undefined} />
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?