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

useText

Reads one text record, such as url, avatar or com.twitter. Signature, options, result and examples for useText in @ensforge/react.

Read hookstable
Since v1.0.0View source

Reads one text record, such as url, avatar or com.twitter. Preset of useRead(Actions.record.getText, …).

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

Signature

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

Examples

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

function View() {
  const { data: url } = useText({ name: "nick.eth", key: "url" })
  return <span>{url}</span>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?