Skip to content

Commit 36fc970

Browse files
committed
chore: Update ts define
1 parent d5f7c56 commit 36fc970

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

src/DropdownMenu.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Menu, { MenuItem } from 'rc-menu';
22
import * as React from 'react';
3-
import { MentionsContextConsumer, MentionsContextProps } from './MentionsContext';
3+
import {
4+
MentionsContextConsumer,
5+
MentionsContextProps,
6+
} from './MentionsContext';
47
import { OptionProps } from './Option';
58

69
interface DropdownMenuProps {
@@ -28,7 +31,7 @@ class DropdownMenu extends React.Component<DropdownMenuProps, {}> {
2831
<Menu
2932
prefixCls={`${prefixCls}-menu`}
3033
activeKey={activeOption.value}
31-
onSelect={({ key }: { key: string }) => {
34+
onSelect={({ key }: { key: React.Key }) => {
3235
const option = options.find(({ value }) => value === key);
3336
selectOption(option);
3437
}}
@@ -58,7 +61,9 @@ class DropdownMenu extends React.Component<DropdownMenuProps, {}> {
5861
};
5962

6063
public render() {
61-
return <MentionsContextConsumer>{this.renderDropdown}</MentionsContextConsumer>;
64+
return (
65+
<MentionsContextConsumer>{this.renderDropdown}</MentionsContextConsumer>
66+
);
6267
}
6368
}
6469

src/KeywordTrigger.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,27 @@ interface KeywordTriggerProps {
3232
visible?: boolean;
3333
transitionName?: string;
3434
getPopupContainer?: () => HTMLElement;
35+
children?: React.ReactElement;
3536
}
3637

3738
class KeywordTrigger extends React.Component<KeywordTriggerProps, {}> {
3839
public getDropdownPrefix = () => `${this.props.prefixCls}-dropdown`;
3940

4041
public getDropdownElement = () => {
4142
const { options } = this.props;
42-
return <DropdownMenu prefixCls={this.getDropdownPrefix()} options={options} />;
43+
return (
44+
<DropdownMenu prefixCls={this.getDropdownPrefix()} options={options} />
45+
);
4346
};
4447

4548
public render() {
46-
const { children, visible, placement, transitionName, getPopupContainer } = this.props;
49+
const {
50+
children,
51+
visible,
52+
placement,
53+
transitionName,
54+
getPopupContainer,
55+
} = this.props;
4756

4857
const popupElement = this.getDropdownElement();
4958

0 commit comments

Comments
 (0)