Skip to content

Commit ab7e590

Browse files
committed
fix ts error
1 parent 32b594c commit ab7e590

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/calendar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export interface CalendarProps extends CalendarHeaderProps, DayProps {
7373
}
7474

7575
interface CalendarState {
76-
prevInitialDate: any;
76+
prevInitialDate?: string;
7777
currentMonth: any;
7878
}
7979
/**
@@ -145,7 +145,7 @@ class Calendar extends Component<CalendarProps, CalendarState> {
145145
header: React.RefObject<CalendarHeader> = React.createRef();
146146

147147
static getDerivedStateFromProps(nextProps: CalendarProps, prevState: CalendarState) {
148-
if (nextProps?.initialDate && toMarkingFormat(nextProps?.initialDate) !== toMarkingFormat(prevState.prevInitialDate)) {
148+
if (nextProps?.initialDate && nextProps?.initialDate !== prevState.prevInitialDate) {
149149
return {
150150
prevInitialDate: nextProps.initialDate,
151151
currentMonth: parseDate(nextProps.initialDate)

0 commit comments

Comments
 (0)