FormField
This is a React component

Source
import { FormField } from "@prestojs/final-form";
FormField(props)

Wrapper around Field from react-final-form that determines the widget to use based on the field.

Must be used within a ViewModelForm.

If component, render or children are passed they will be used instead of selecting a widget based on the field type.

If field is passed through defaultValue will be populated unless otherwise specified. Note that if the same field is specified in initialValues in Form then that takes precedence.

ParameterTypeDescription
*props.fieldany

The field to get name, widget and default value from. If not specified you must provide one of component, children or render.

*props.nameany

The name of the field. If not specified defaults to field.name. If field is not specified you must provide this.

*props.widgetPropsany

Optional props to pass through to the inferred widget. This is only used if field is provided and none of component, render or children are provided.

*...restfieldProps|fieldProps

Any other props to pass through to Field