From e063e1916d0af0f5897ed8fe9de5f33a78ed9751 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Sun, 30 Sep 2018 16:39:51 +0800 Subject: [PATCH] fix: more types --- components/layout/Sider.tsx | 6 ++++-- site/theme/template/IconDisplay/index.tsx | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index 6552d87201..c70b2a6909 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -134,7 +134,8 @@ class Sider extends React.Component { componentDidMount() { if (this.mql) { - this.mql.addListener(this.responsiveHandler); + const self = this; + this.mql.addListener(function() { self.responsiveHandler(this) }); this.responsiveHandler(this.mql); } @@ -145,7 +146,8 @@ class Sider extends React.Component { componentWillUnmount() { if (this.mql) { - this.mql.removeListener(this.responsiveHandler); + const self = this; + this.mql.removeListener(function() { self.responsiveHandler(this) }); } if (this.context.siderHook) { diff --git a/site/theme/template/IconDisplay/index.tsx b/site/theme/template/IconDisplay/index.tsx index ea8fb8e1d9..b4fe68fa35 100644 --- a/site/theme/template/IconDisplay/index.tsx +++ b/site/theme/template/IconDisplay/index.tsx @@ -1,16 +1,14 @@ import * as React from 'react'; -import { ThemeType, IconType } from '../../../../components/icon'; +import { ThemeType } from '../../../../components/icon'; import manifest from '@ant-design/icons/lib/manifest'; import { ThemeType as ThemeFolderType } from '@ant-design/icons/lib/types'; import Category from './Category'; -import { Radio, Icon as AntdIcon } from 'antd'; +import { Radio, Icon } from 'antd'; import { RadioChangeEvent } from 'antd/lib/radio/interface'; import { FilledIcon, OutlinedIcon, TwoToneIcon } from './themeIcons'; import { categories, Categories, CategoriesKeys } from './fields'; import { injectIntl, InjectedIntlProps } from 'react-intl'; -const Icon: IconType = AntdIcon as any; - interface IconDisplayProps extends InjectedIntlProps { }