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