Skip to content

Function: useField() ​

Call Signature ​

ts
function useField<Value, Output>(node): FieldView<Value, Output>;

Defined in: react/src/use-field.ts:55

Binds a field node to an input, typed by the node. The component re-renders only when the field's state or attributes change.

Type Parameters ​

Type Parameter
Value
Output

Parameters ​

ParameterType
nodeFieldNode<Value, Output>

Returns ​

FieldView<Value, Output>

Call Signature ​

ts
function useField<Value>(name): FieldView<Value | undefined, unknown>;

Defined in: react/src/use-field.ts:60

Binds the field at name, relative to the nearest provided node, to an input. The component re-renders only when that field's state or attributes change.

Type Parameters ​

Type Parameter
Value

Parameters ​

ParameterType
namestring

Returns ​

FieldView<Value | undefined, unknown>

Released under the MIT License.