UNPKG

851 BTypeScriptView Raw
1/**
2 * Stabilizes the ListContext value for the MenuItem component, so it doesn't change when sibling items update.
3 *
4 * @param id The id of the MenuItem. If undefined, it will be generated with useId.
5 * @returns The stable ListContext value and the id of the MenuItem.
6 *
7 * Demos:
8 *
9 * - [Menu](https://mui.com/base-ui/react-menu/#hooks)
10 *
11 * API:
12 *
13 * - [useMenuItemContextStabilizer API](https://mui.com/base-ui/react-menu/hooks-api/#use-menu-item-context-stabilizer)
14 */
15export declare function useMenuItemContextStabilizer(id: string | undefined): {
16 contextValue: {
17 dispatch: (action: import("../useList").ListAction<string>) => void;
18 getItemState: (itemValue: string) => {
19 highlighted: boolean;
20 selected: boolean;
21 focusable: boolean;
22 };
23 };
24 id: string | undefined;
25};