@lynxts/core • Docs
@lynxts/core / 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
.
• T extends Struct
• V
• D = Optional
<V
>
the path of the field in T
• fallback?: D
optional default value the field should take
UseField
<V
, D
>
an object with the field value and some helper functions