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

useSubnames

Lists a name's subnames, page by page, from the indexer. Signature, options, result and examples for useSubnames in @ensforge/react.

Read hookstable
Since v1.0.0View source

Lists a name's subnames, page by page, from the indexer. Preset of useInfiniteRead(Actions.indexer.getSubnames, …).

It wraps indexer.getSubnames: the same options, result and errors.

Signature

function useSubnames(options: Omit<Actions.indexer.getSubnames.Options, "cursor">, config?: { readonly client?: ReadConfig["client"] }): InfiniteReadResult< Actions.indexer.getSubnames.ReturnType, Actions.indexer.getSubnames.ErrorType >

Examples

A list with
import { useSubnames } from "@ensforge/react"

function List() {
  const { items, hasMore, loadMore } = useSubnames({ name: "ens.eth" })
  return <button disabled={!hasMore} onClick={loadMore}>{items.length}</button>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?