In some cases, businesses have requirements that fields in the form appear as a result of interaction with the user, therefore, they will not be known statically (in advance) and need to provide a powerful and user-friendly API to allow developers to create such forms.
New API's
createDynamicForm — creates dynamic form
function createDynamicForm<Schema>(
options?: CreateFormOptions<Schema>
): DynamicFormType<Fields, Values, Errors>;
field, arrayField, fieldsGroup — for dynamic form schema pre-define
Dynamic Forms RFC
Motivation
In some cases, businesses have requirements that fields in the form appear as a result of interaction with the user, therefore, they will not be known statically (in advance) and need to provide a powerful and user-friendly API to allow developers to create such forms.
New API's
createDynamicForm
— creates dynamic formfield
,arrayField
,fieldsGroup
— for dynamic form schema pre-defineDynamicForm
— dynamic form typeAPI changes
FormType
— addget
methodNow, in static form, it will also be possible to get a field by key immediately with typings
Examples