menu icon indicating copy to clipboard operation
menu copied to clipboard

`Item` and `SubMenu` are exported as `any` in typescript typings

Open burtek opened this issue 5 years ago • 3 comments

Menu and Divider is typed correctly: image

But Item and SubMenu are not: image image

which is because of const connected being of type any: image

burtek avatar Nov 13 '19 12:11 burtek

hey, did you ever figure out a workaround for this?

woodbridge avatar Apr 21 '20 23:04 woodbridge

@woodbridge nah, I just ignored that

burtek avatar Apr 22 '20 08:04 burtek

import React,{ ComponentClass } from 'react'; import RcMenu, { SubMenu, MenuItem } from 'rc-menu'; import { SubMenuProps } from 'rc-menu/lib/SubMenu';

const RcSubMenu = SubMenu as ComponentClass<SubMenuProps>;

use RcSubMenu replace SubMenu

gaofanni avatar Apr 01 '21 07:04 gaofanni