ant-design/components/menu/OverrideContext.ts
二货机器人 99c16aa8d6
refactor: Fix Dropdown nesting menu injection logic (#35810)
* refactor: Dependency Inversion

* test: update snapshot

* test: Update snapshot

* test: more

* fix: table dropdown logic

* fix: menu lint
2022-05-30 19:06:51 +08:00

17 lines
519 B
TypeScript

import * as React from 'react';
import type { MenuProps } from '.';
// Used for Dropdown only
export interface OverrideContextProps {
prefixCls?: string;
expandIcon?: React.ReactNode;
mode?: MenuProps['mode'];
selectable?: boolean;
validator?: (menuProps: Pick<MenuProps, 'mode'>) => void;
}
/** @private Internal Usage. Only used for Dropdown component. Do not use this in your production. */
const OverrideContext = React.createContext<OverrideContextProps | null>(null);
export default OverrideContext;