Skip to content

Commit b98c2cc

Browse files
committed
Do not expose the internal id props for Menu
1 parent 1dd4a2e commit b98c2cc

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/Header/MainNavigation/MainNavigation.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ export namespace MainNavigationProps {
3636
};
3737

3838
export type Menu = Common & {
39-
menuProps: MenuProps;
4039
linkProps?: undefined;
40+
menuProps: MenuProps;
4141
megaMenuProps?: undefined;
4242
};
4343

4444
export type MegaMenu = Common & {
45-
megaMenuProps: MegaMenuProps;
46-
menuProps?: undefined;
4745
linkProps?: undefined;
46+
menuProps?: undefined;
47+
megaMenuProps: MegaMenuProps;
4848
};
4949
}
5050
}

src/Header/MainNavigation/MegaMenu.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import type { Equals } from "tsafe";
77

88
export type MegaMenuProps = {
99
className?: string;
10-
id: string;
1110
classes?: Partial<Record<"root", string>>;
1211
};
1312

1413
export const MegaMenu = memo(
15-
forwardRef<HTMLDivElement, MegaMenuProps>((props, ref) => {
14+
forwardRef<HTMLDivElement, MegaMenuProps & { id: string }>((props, ref) => {
1615
const { className, id, classes = {}, ...rest } = props;
1716

1817
assert<Equals<keyof typeof rest, never>>();

src/Header/MainNavigation/Menu.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { useLink } from "../../lib/routing";
1010

1111
export type MenuProps = {
1212
className?: string;
13-
id: string;
1413
classes?: Partial<Record<"root" | "list", string>>;
1514
items: {
1615
text: ReactNode;
@@ -20,7 +19,7 @@ export type MenuProps = {
2019
};
2120

2221
export const Menu = memo(
23-
forwardRef<HTMLDivElement, MenuProps>((props, ref) => {
22+
forwardRef<HTMLDivElement, MenuProps & { id: string }>((props, ref) => {
2423
const { className, id, classes = {}, items, ...rest } = props;
2524

2625
assert<Equals<keyof typeof rest, never>>();

0 commit comments

Comments
 (0)