import { useFormContext } from '../context';
import { isFieldArrayModel } from '../models';
import { useModelFromContext } from './use-model';
import { useObservableState } from 'observable-hooks';
import { NEVER } from 'rxjs';
export function useFieldArrayChildModels(field) {
    var _a;
    var ctx = useFormContext(typeof field !== 'string');
    var model = useModelFromContext(ctx, field, field, isFieldArrayModel);
    return useObservableState((_a = model === null || model === void 0 ? void 0 : model.children$) !== null && _a !== void 0 ? _a : NEVER);
}
