Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilag committed Oct 5, 2021
1 parent 28b0acf commit 79e728c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/FormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export function useFieldArray(props: IFieldArrayProps) {
get
).data;
},
[fieldArrayProps]
[]
);

const remove = useRecoilTransaction_UNSTABLE(
Expand Down Expand Up @@ -426,7 +426,12 @@ export function useFieldArray(props: IFieldArrayProps) {
type: 'field-array',
formId: initialValues.formId,
}),
(val) => Object.assign({}, val, { validate, fieldNames })
(val) =>
Object.assign({}, val, {
validate,
fieldNames,
initVer: initialValues.version,
} as Partial<IFieldArrayAtomValue>)
);
if (initialValue?.length) {
setFieldArrayDataAndExtraInfo(
Expand Down Expand Up @@ -520,12 +525,13 @@ const getFormValues = (get: (val: RecoilValue<any>) => any) => {
const extraInfos: any = {};
const initialValues = get(formInitialValuesAtom) as InitialValues;
const formId = initialValues.formId;
const fieldArrays = Object.values(
combinedFieldAtomValues[formId].fieldArrays
);
for (const fieldAtomValue of Object.values(
combinedFieldAtomValues[formId].fields
)) {
const fieldArrays = combinedFieldAtomValues[formId]
? Object.values(combinedFieldAtomValues[formId].fieldArrays)
: [];
const fields = combinedFieldAtomValues[formId]
? Object.values(combinedFieldAtomValues[formId].fields)
: [];
for (const fieldAtomValue of fields) {
const ancestors = fieldAtomValue.param.ancestors;
let pathAncestors: { name: string; index: number }[] = [];
if (ancestors.length) {
Expand Down

0 comments on commit 79e728c

Please sign in to comment.