Skip to content

Commit ecaa065

Browse files
committed
Add some comments [no ci]
1 parent fb34fc0 commit ecaa065

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/ra-ui-materialui/src/input/ArrayInput/SimpleFormIterator.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ export const SimpleFormIterator = (inProps: SimpleFormIteratorProps) => {
6464
const records = get(record, finalSource);
6565

6666
return (
67-
<SimpleFormIteratorBase inputs={children} {...props}>
67+
<SimpleFormIteratorBase
68+
// SimpleFormIteratorBase needs to know the actual inputs to correctly handle new items
69+
// (single item without source, or multiple items, FormDataConsumer...)
70+
// See its addField function
71+
inputs={children}
72+
{...props}
73+
>
6874
<Root
6975
className={clsx(
7076
className,
@@ -116,10 +122,7 @@ export const SimpleFormIterator = (inProps: SimpleFormIteratorProps) => {
116122
};
117123

118124
export interface SimpleFormIteratorProps
119-
extends Omit<
120-
SimpleFormIteratorBaseProps,
121-
'children' | 'render' | 'inputs'
122-
> {
125+
extends Omit<SimpleFormIteratorBaseProps, 'children' | 'inputs'> {
123126
addButton?: ReactNode;
124127
children?: ReactNode;
125128
className?: string;

0 commit comments

Comments
 (0)