diff --git a/packages/react/src/components/RecursionField.tsx b/packages/react/src/components/RecursionField.tsx index 81c16afd03b..4db47b0cfc6 100644 --- a/packages/react/src/components/RecursionField.tsx +++ b/packages/react/src/components/RecursionField.tsx @@ -32,6 +32,8 @@ export const RecursionField: React.FC = (props) => { return props.basePath || parent?.address } const basePath = getBasePath() + const children = + fieldSchema['x-content'] || fieldSchema['x-component-props']?.['children'] const renderProperties = (field?: Formily.Core.Types.GeneralField) => { if (props.onlyRenderSelf) return return ( @@ -59,7 +61,7 @@ export const RecursionField: React.FC = (props) => { /> ) })} - {fieldSchema['x-content']} + {children} ) } @@ -75,7 +77,9 @@ export const RecursionField: React.FC = (props) => { ) } else if (fieldSchema.type === 'array') { return ( - + + {children} + ) } else if (fieldSchema.type === 'void') { if (props.onlyRenderProperties) return renderProperties() @@ -87,8 +91,7 @@ export const RecursionField: React.FC = (props) => { } return ( - {fieldSchema['x-content'] || - fieldSchema['x-component-props']?.['children']} + {children} ) }