createFormArray
<ValuesType>() => (fields: Fields) => FormArrayConfig
Description
creatFormArray
is a curried function - like createForm
- that can be used to create an instance of FormArrayConfig
.
Generic Types
ValuesType
Type of field values.
Arguments
field
Fields
Object of fields (see Field
for configuration details).
Needs to match with properties of ValuesType
.
Example
type RegistrationForm = { username: string; password: string };
const formConfig = createForm<RegistrationForm>()({
username: field.text(),
password: field.password()
});
// values will be of type RegistrationForm
const { values } = useFluentFormArray(formConfig);