Field
Functions
Field
▸ Field<Value, Key, Ref>(props): Element
A Field is a consumer of some data in its' parent Form. The user interface of a Field
is completely determined by you, the developer. This component abstracts away all of the
complexities of dealing with inputs, values, events, and validations.
function UserProfile() {
return (
<Form name="UserProfile" initialValues={{ firstName: "" }}>
<Field name="firstName" type="text" required pattern={/\w+/} as={({ input }) => <input {...input} />} />
</Form>
);
}
Type parameters
| Name | Type |
|---|---|
Value | extends FieldValue = FieldValue |
Key | extends string = string |
Ref | HTMLInputElement |
Parameters
| Name | Type | Description |
|---|---|---|
props | WebFieldProps<Value, Key, Ref> | FieldProps - The react props for the field component. |
Returns
Element