Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/react-hook-form.ts

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
import * as netzo from "https://deno.land/x/netzo@0.4.87/deps/react-hook-form.ts";

Variables

Component based on useController hook to work with controlled component.

A provider component that propagates the useForm methods to all children components via React Context API. To be used with useFormContext.

This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with FormProvider.

Functions

Form component to manage submission.

Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.

A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • DemoVideo

Custom hook to manage the entire form.

This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.

Subscribe to the entire form values change and re-render at the hook level.

Type Aliases

Type which eagerly collects all paths through a type which point to an array type.

Render function to provide the control for the field.

useFieldArray focus option, ability to toggle focus on and off with shouldFocus and setting focus by either field index or name.

useFieldArray returned fields with unique id

See Path

Type which eagerly collects all paths through a fieldType that matches a give type

Type to evaluate the type which the given paths point to.

Checks whether the type is any See https://stackoverflow.com/a/49928360/3406963

Checks whether T1 can be exactly (mutually) assigned to T2

Checks whether the type is never

T
NestedValue
deprecated

Type which eagerly collects all paths through a type

Type alias to string which describes a lodash-like path through an object. E.g. 'foo.bar.0.baz'

Type to evaluate the type which the given path points to.

Append field/fields to the end of your fields and focus. The input value will be registered during this action.

Insert field/fields at particular position and focus.

Move field array by supplying from and to index

Prepend field/fields to the start of the fields and optionally focus. The input value will be registered during this action.

Remove field/fields at particular position.

Replace the entire field array values.

Swap field array by supplying from and to index

Update field/fields at particular position.

Clear the entire form errors.

This method will return individual field states. It will be useful when you are trying to retrieve the nested value field state in a typesafe approach.

Validate the entire form. Handle submit and error callback.

Register field into hook form with or without the actual DOM ref. You can invoke register anywhere in the component including at useEffect.

Reset at the entire form state.

Reset a field state and reference.

Set an error for the field. When set an error which is not associated to a field then manual clearErrors invoke is required.

Set focus on a registered field. You can start to invoke this method after all fields are mounted to the DOM.

Set a single field value, or a group of fields value.

Trigger field or form validation

Unregister a field reference and remove its value.