Skip to content

Commit

Permalink
Add definition for Menu.SubMenu (#14488)
Browse files Browse the repository at this point in the history
Fix Menu.SubMenu props from any to real def
  • Loading branch information
MaoYiWei authored and zombieJ committed Jan 23, 2019
1 parent ee644ce commit 5ec4383
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/menu/SubMenu.tsx
Expand Up @@ -3,7 +3,15 @@ import * as PropTypes from 'prop-types';
import { SubMenu as RcSubMenu } from 'rc-menu';
import classNames from 'classnames';

class SubMenu extends React.Component<any, any> {
export interface SubMenuProps {
rootPrefixCls?: string;
className?: string;
disabled?: boolean;
title?: React.ReactNode;
onTitleClick?: (key: string, domEvent?: Event) => void;

This comment has been minimized.

Copy link
@DwE1

DwE1 Jan 28, 2019

官方文档中,onTitleClick的使用方式是:function({ key, domEvent }),为什么interface中定义onTitleClick是(key: string, domEvent?: Event)?

This comment has been minimized.

Copy link
@afc163

afc163 Jan 28, 2019

Member

帮助确认下哪个是对的,来个 PR 修正一下吧。

This comment has been minimized.

Copy link
@zombieJ

zombieJ Jan 28, 2019

Member

Nice catch. 应该是写错了

This comment has been minimized.

Copy link
@zombieJ

zombieJ Jan 28, 2019

Member
}

class SubMenu extends React.Component<SubMenuProps, any> {
static contextTypes = {
antdMenuTheme: PropTypes.string,
};
Expand Down

0 comments on commit 5ec4383

Please sign in to comment.