/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/MenuList/MenuListContext.tsx
30 строк
713 B
Albert Yu
[utils] Explicitly register roving tab items with parent (#48122)
02 апр 2026, 13:42
Не верифицирован
02 апр 2026, 13:42
a2ac691
Код
Авторство
О чём код?
'use client'; import * as React from 'react'; /** * @ignore - internal component. */ export interface MenuListContextValue { itemsFocusableWhenDisabled: boolean; suppressInitialFocusVisible: boolean; variant: 'menu' | 'selectedMenu'; } export const MenuListContext = React.createContext<MenuListContextValue | undefined>(undefined); if (process.env.NODE_ENV !== 'production') { MenuListContext.displayName = 'MenuListContext'; } export function useMenuListContext() { const context = React.useContext(MenuListContext); if (context === undefined) { throw new Error( 'MUI: MenuListContext is missing. MenuItems must be placed within Menu or MenuList.', ); } return context; }