@modular-forms/qwik
Version:
The modular and type-safe form library for Qwik
12 lines (11 loc) • 482 B
JavaScript
import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime";
import { getFieldArrayStore } from '../utils';
import { Lifecycle } from './Lifecycle';
/**
* Headless field array that provides reactive properties and state.
*/
export function FieldArray({ children, name, ...props }) {
// Get store of specified field
const fieldArray = getFieldArrayStore(props.of, name);
return (_jsx(Lifecycle, { store: fieldArray, ...props, children: children(fieldArray) }, name));
}