mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-18 11:18:14 +08:00
refactor: use instanceof instead typeof
This commit is contained in:
parent
2bf2bb5af4
commit
ff0595733f
@ -831,8 +831,8 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
|
|||||||
renderColumnTitle(title: ColumnProps<T>['title']) {
|
renderColumnTitle(title: ColumnProps<T>['title']) {
|
||||||
const { filters, sortOrder } = this.state;
|
const { filters, sortOrder } = this.state;
|
||||||
// https://github.com/ant-design/ant-design/issues/11246#issuecomment-405009167
|
// https://github.com/ant-design/ant-design/issues/11246#issuecomment-405009167
|
||||||
if (typeof title === 'function') {
|
if (title instanceof Function) {
|
||||||
return (title as Function)({
|
return title({
|
||||||
filters,
|
filters,
|
||||||
sortOrder,
|
sortOrder,
|
||||||
});
|
});
|
||||||
|
@ -219,8 +219,8 @@ export default class FilterMenu<T> extends React.Component<FilterMenuProps<T>, F
|
|||||||
[`${dropdownPrefixCls}-menu-without-submenu`]: !this.hasSubMenu(),
|
[`${dropdownPrefixCls}-menu-without-submenu`]: !this.hasSubMenu(),
|
||||||
});
|
});
|
||||||
let { filterDropdown } = column;
|
let { filterDropdown } = column;
|
||||||
if (typeof filterDropdown === 'function') {
|
if (filterDropdown instanceof Function) {
|
||||||
filterDropdown = (filterDropdown as Function)({
|
filterDropdown = filterDropdown({
|
||||||
prefixCls: `${dropdownPrefixCls}-custom`,
|
prefixCls: `${dropdownPrefixCls}-custom`,
|
||||||
setSelectedKeys: (selectedKeys: Array<any>) => this.setSelectedKeys({ selectedKeys }),
|
setSelectedKeys: (selectedKeys: Array<any>) => this.setSelectedKeys({ selectedKeys }),
|
||||||
selectedKeys: this.state.selectedKeys,
|
selectedKeys: this.state.selectedKeys,
|
||||||
|
Loading…
Reference in New Issue
Block a user