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']) {
|
||||
const { filters, sortOrder } = this.state;
|
||||
// https://github.com/ant-design/ant-design/issues/11246#issuecomment-405009167
|
||||
if (typeof title === 'function') {
|
||||
return (title as Function)({
|
||||
if (title instanceof Function) {
|
||||
return title({
|
||||
filters,
|
||||
sortOrder,
|
||||
});
|
||||
|
@ -219,8 +219,8 @@ export default class FilterMenu<T> extends React.Component<FilterMenuProps<T>, F
|
||||
[`${dropdownPrefixCls}-menu-without-submenu`]: !this.hasSubMenu(),
|
||||
});
|
||||
let { filterDropdown } = column;
|
||||
if (typeof filterDropdown === 'function') {
|
||||
filterDropdown = (filterDropdown as Function)({
|
||||
if (filterDropdown instanceof Function) {
|
||||
filterDropdown = filterDropdown({
|
||||
prefixCls: `${dropdownPrefixCls}-custom`,
|
||||
setSelectedKeys: (selectedKeys: Array<any>) => this.setSelectedKeys({ selectedKeys }),
|
||||
selectedKeys: this.state.selectedKeys,
|
||||
|
Loading…
Reference in New Issue
Block a user