Skip to content

Commit 18a1624

Browse files
committed
Fix: Apply a default defalutValue on ArrayInput
1 parent 52eefab commit 18a1624

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import { ArrayInputContext } from './ArrayInputContext';
7474
export const ArrayInput = (props: ArrayInputProps) => {
7575
const {
7676
className,
77-
defaultValue,
77+
defaultValue = [],
7878
label,
7979
isFetching,
8080
isLoading,
@@ -131,7 +131,7 @@ export const ArrayInput = (props: ArrayInputProps) => {
131131
}, [finalSource, formGroups, formGroupName]);
132132

133133
useApplyInputDefaultValues({
134-
inputProps: props,
134+
inputProps: { ...props, defaultValue },
135135
isArrayInput: true,
136136
fieldArrayInputControl: fieldProps,
137137
});

0 commit comments

Comments
 (0)