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
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,WriteResultandReadConfig.
Was this page helpful?