Skip to content

Commit 9fc76b5

Browse files
authored
fix(Menu): children as function * 2 (#701)
1 parent 5743e5e commit 9fc76b5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/eight-dingos-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Fix Menu type.

src/components/pickers/Menu/Menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export interface CubeMenuProps<T>
4040
sectionStyles?: Styles;
4141
sectionHeadingStyles?: Styles;
4242
qa?: BaseProps['qa'];
43-
/** Menu accepts <Menu.Item>, <Menu.Section>, and <Divider> as children */
44-
children?: React.ReactNode;
43+
/** Menu accepts <Menu.Item>, <Menu.Section>, and <Divider> as children, or a function for dynamic collections */
44+
children?: React.ReactNode | ((item: T) => React.ReactElement);
4545
/** Keys that should appear disabled */
4646
disabledKeys?: Iterable<Key>;
4747
/** Selection mode for the menu: 'single' | 'multiple' */

0 commit comments

Comments
 (0)