@modular-forms/react
Version:
The modular and type-safe form library for React
14 lines (13 loc) • 320 B
JavaScript
/**
* Returns a tuple with all field and field array stores of a form.
*
* @param form The form of the stores.
*
* @returns The store tuple.
*/
export function getFieldAndArrayStores(form) {
return [
...Object.values(form.internal.fields),
...Object.values(form.internal.fieldArrays),
];
}