From 4601144f3fcdca90aba4267f57f70df6756e1052 Mon Sep 17 00:00:00 2001 From: zy410419243 Date: Thu, 7 Mar 2019 16:33:59 +0800 Subject: [PATCH] refactor: update lifecycle method for Calendar --- components/calendar/index.tsx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/components/calendar/index.tsx b/components/calendar/index.tsx index 67bdf81a9a..787e6d0d18 100644 --- a/components/calendar/index.tsx +++ b/components/calendar/index.tsx @@ -7,6 +7,7 @@ import enUS from './locale/en_US'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; import interopDefault from '../_util/interopDefault'; +import { polyfill } from 'react-lifecycles-compat'; export { HeaderProps } from './Header'; @@ -48,7 +49,7 @@ export interface CalendarState { mode?: CalendarMode; } -export default class Calendar extends React.Component { +class Calendar extends React.Component { static defaultProps = { locale: {}, fullscreen: true, @@ -74,6 +75,13 @@ export default class Calendar extends React.Component