useSetRecords
Sets, changes or clears a name's records in one write. Signature, options, result and examples for useSetRecords in @ensforge/react.
Write hookstable
Since v1.0.0View source
Sets, changes or clears a name's records in one write. Preset of useWrite(Actions.record.set).
It wraps record.set: the same options, result and errors.
Signature
function useSetRecords(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.record.set>[1], Actions.record.set.ReturnType, Actions.record.set.ErrorType >Examples
import { useSetRecords } from "@ensforge/react"
function Send() {
const { mutate, isPending } = useSetRecords()
return <button disabled={isPending} onClick={() => mutate({ name: "alice.eth", texts: { url: "https://alice.xyz" } })}>Send</button>
}See also
- The hook types:
ReadResult,WriteResultandReadConfig.
Was this page helpful?