> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Module: react-hook-form

> React Hook Form bound to one recoverable Bijection operation request.

React Hook Form bound to one recoverable Bijection operation request.

React Hook Form owns live input, registration, validation and its error
presentation; Bijection owns the durable draft, the captured request,
retries and recovery.

## Type Aliases

### Op

Ƭ **Op**: [`OperationReference`](https://docs.bijection.com/api/modules/server#operationreference)\<`"public"`, `any`, `any`>

Not exported: an exported type refers to it.

***

### ReactHookFormInput

Ƭ **ReactHookFormInput**: `FieldValues` & \{ `[key: string]`: [`Value`](https://docs.bijection.com/api/modules/values#value) | `undefined`;  }

Editable input a draft can retain losslessly.

***

### ReactHookFormBindingOptions

Ƭ **ReactHookFormBindingOptions**\<`O`, `Input`, `Context`, `Output`>: `Omit`\<[`UseOperationBindingOptions`](https://docs.bijection.com/api/modules/react#useoperationbindingoptions)\<`O`, `Input`, `Output`>, `"editor"`> & \{ `form`: `Omit`\<`UseFormProps`\<`Input`, `Context`, `Output`>, `"values"`>  }

#### Type parameters

| Name | Type |
| :- | :- |
| `O` | extends [`Op`](https://docs.bijection.com/api/modules/react_hook_form#op) |
| `Input` | extends [`ReactHookFormInput`](https://docs.bijection.com/api/modules/react_hook_form#reacthookforminput) |
| `Context` | `Context` |
| `Output` | `Output` |

## Functions

### reactHookFormEditor

▸ **reactHookFormEditor**\<`Input`, `Context`, `Output`>(`form`): [`OperationEditor`](https://docs.bijection.com/api/interfaces/browser.OperationEditor)\<`Input`, `Output`>

Adapt a React Hook Form instance to the editor protocol. Submission runs
its own `handleSubmit`, so its submission state, focus and post-submit
revalidation are its own.

#### Type parameters

| Name | Type |
| :- | :- |
| `Input` | extends [`ReactHookFormInput`](https://docs.bijection.com/api/modules/react_hook_form#reacthookforminput) |
| `Context` | `Context` |
| `Output` | `Output` |

#### Parameters

| Name | Type |
| :- | :- |
| `form` | `UseFormReturn`\<`Input`, `Context`, `Output`> |

#### Returns

[`OperationEditor`](https://docs.bijection.com/api/interfaces/browser.OperationEditor)\<`Input`, `Output`>

***

### useReactHookFormBinding

▸ **useReactHookFormBinding**\<`O`, `Input`, `Context`, `Output`>(`operation`, `options`): `Object`

Create a React Hook Form and bind it to one recoverable operation request.
`form` is React Hook Form's own instance, typed from its options: register
fields, render `Controller`s and read `formState` as usual. Its submitted
output, such as a resolver's transformation, must satisfy the operation's
arguments. `isSubmitSuccessful` describes the local submission; whether the
request was accepted is `binding`'s state.

#### Type parameters

| Name | Type |
| :- | :- |
| `O` | extends [`Op`](https://docs.bijection.com/api/modules/react_hook_form#op) |
| `Input` | extends [`ReactHookFormInput`](https://docs.bijection.com/api/modules/react_hook_form#reacthookforminput) |
| `Context` | `any` |
| `Output` | `Input` |

#### Parameters

| Name | Type |
| :- | :- |
| `operation` | `O` |
| `options` | [`ReactHookFormBindingOptions`](https://docs.bijection.com/api/modules/react_hook_form#reacthookformbindingoptions)\<`O`, `Input`, `Context`, `Output`> |

#### Returns

`Object`

| Name | Type |
| :- | :- |
| `form` | `UseFormReturn`\<`Input`, `Context`, `Output`> |
| `binding` | [`MountedOperationBinding`](https://docs.bijection.com/api/modules/react#mountedoperationbinding)\<`O`, `Input`> |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.