fix: sub-form record provider data failed to matching (#2337)

This commit is contained in:
katherinehhh 2023-07-27 22:38:10 +08:00 committed by GitHub
parent 6aefff7409
commit e8c9164b5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ import React, { useContext } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { AssociationFieldContext } from './context'; import { AssociationFieldContext } from './context';
import { useAssociationFieldContext } from './hooks'; import { useAssociationFieldContext } from './hooks';
import { RecordProvider, useRecord } from '../../../record-provider';
export const Nester = (props) => { export const Nester = (props) => {
const { options } = useContext(AssociationFieldContext); const { options } = useContext(AssociationFieldContext);
@ -92,7 +93,9 @@ const ToManyNester = observer(
</Tooltip> </Tooltip>
)} )}
</div> </div>
<RecursionField onlyRenderProperties basePath={field.address.concat(index)} schema={fieldSchema} /> <RecordProvider record={value}>
<RecursionField onlyRenderProperties basePath={field.address.concat(index)} schema={fieldSchema} />
</RecordProvider>
<Divider /> <Divider />
</React.Fragment> </React.Fragment>
); );