We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d66b56e + 8dc1517 commit ea05225Copy full SHA for ea05225
packages/ra-core/src/controller/list/useExpanded.tsx
@@ -24,7 +24,7 @@ export const useExpanded = (
24
): [boolean, () => void] => {
25
const [expandedIds, setExpandedIds] = useStore<Identifier[]>(
26
`${resource}.datagrid.expanded`,
27
- []
+ emptyArray
28
);
29
const expanded = Array.isArray(expandedIds)
30
? // eslint-disable-next-line eqeqeq
@@ -50,6 +50,8 @@ export const useExpanded = (
50
return [expanded, toggleExpanded];
51
};
52
53
+const emptyArray: Identifier[] = [];
54
+
55
/**
56
* State-like hook for controlling the expanded state of many list items
57
* expanded state is true when at least one item from ids is expanded.
0 commit comments