Skip to content

Latest commit

 

History

History
42 lines (22 loc) · 1.02 KB

useField.md

File metadata and controls

42 lines (22 loc) · 1.02 KB

@lynxts/coreDocs


@lynxts/core / useField

Function: useField()

useField<T, V, D>(path, fallback?): UseField<V, D>

A hook to handle fields in the form. It provides the current value of the field and helper function to change its state.

If the fallback parameter is not set, the default value is undefined.

Type Parameters

T extends Struct

V

D = Optional<V>

Parameters

path: Path<T, Optional<V>>

the path of the field in T

fallback?: D

optional default value the field should take

Returns

UseField<V, D>

an object with the field value and some helper functions

Defined in

hooks/useField.ts:39