# useSetPrimaryName

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

Sets the signer's primary name. Signature, options, result and examples for useSetPrimaryName in @ensforge/react. Includes examples.

Source: https://ensforge.com/docs/reference/react/use-set-primary-name

<ApiMeta kind="Write hook" stability="stable" since="1.0.0" source="packages/react/src/hooks/named/writes.ts#L215" />

Sets the signer's primary name. Preset of `useWrite(Actions.primaryName.set)`.

It wraps [`primaryName.set`](/docs/reference/sdk/primary-name/set): the same options, result and errors.

## Signature [#signature]

```ts
function useSetPrimaryName(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.primaryName.set>[1], Actions.primaryName.set.ReturnType, Actions.primaryName.set.ErrorType >
```

## Examples [#examples]

```tsx title="A button that sends it"
import { useSetPrimaryName } from "@ensforge/react"

function Send() {
  const { mutate, isPending } = useSetPrimaryName()
  return <button disabled={isPending} onClick={() => mutate({ name: "alice.eth" })}>Send</button>
}
```

## See also [#see-also]

- The [hook types](/docs/reference/react#types): `ReadResult`, `WriteResult` and `ReadConfig`.