Skip to content

Commit 5ecc5a7

Browse files
committed
extract default filter param
1 parent 8f6a113 commit 5ecc5a7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ import { AutocompleteArrayInput } from './AutocompleteArrayInput';
7878
* a `setFilters` function. You can call this function to filter the results.
7979
*/
8080
export const ReferenceArrayInput = (props: ReferenceArrayInputProps) => {
81-
const { children = defaultChildren, reference, sort, filter = {} } = props;
81+
const {
82+
children = defaultChildren,
83+
reference,
84+
sort,
85+
filter = defaultFilter,
86+
} = props;
8287
if (React.Children.count(children) !== 1) {
8388
throw new Error(
8489
'<ReferenceArrayInput> only accepts a single child (like <Datagrid>)'
@@ -116,6 +121,7 @@ ReferenceArrayInput.propTypes = {
116121
};
117122

118123
const defaultChildren = <AutocompleteArrayInput />;
124+
const defaultFilter = {};
119125

120126
export interface ReferenceArrayInputProps
121127
extends InputProps,

0 commit comments

Comments
 (0)