From ef791359b842dc75f73bab03585b3b84f551ebed Mon Sep 17 00:00:00 2001 From: Giacomo Cerquone Date: Wed, 10 Jun 2020 18:30:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#45178=20react-cale?= =?UTF-8?q?ndar:=20value=20prop=20can=20be=20null=20too=20by=20@giacomocer?= =?UTF-8?q?quone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: value can be null too * fix: update react-calendar version in typing header * fix: add tests Co-authored-by: giacomocerquone --- types/react-calendar/index.d.ts | 4 ++-- types/react-calendar/react-calendar-tests.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-calendar/index.d.ts b/types/react-calendar/index.d.ts index 6b6fd7115f..0aee1d4f61 100644 --- a/types/react-calendar/index.d.ts +++ b/types/react-calendar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-calendar 3.0 +// Type definitions for react-calendar 3.1 // Project: https://github.com/wojtekmaj/react-calendar // Definitions by: Stéphane Saquet , Katie Soldau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -62,7 +62,7 @@ export interface CalendarProps { tileClassName?: string | string[] | ((props: CalendarTileProperties) => string | string[] | null); tileContent?: JSX.Element | ((props: CalendarTileProperties) => JSX.Element | null); tileDisabled?: (props: CalendarTileProperties & { activeStartDate: Date }) => boolean; - value?: Date | Date[]; + value?: Date | Date[] | null; view?: Detail; } diff --git a/types/react-calendar/react-calendar-tests.tsx b/types/react-calendar/react-calendar-tests.tsx index 93b0f1be7b..ca2d1650ff 100644 --- a/types/react-calendar/react-calendar-tests.tsx +++ b/types/react-calendar/react-calendar-tests.tsx @@ -2,12 +2,12 @@ import * as React from 'react'; import Calendar from 'react-calendar'; interface State { - value: Date | Date[]; + value: Date | Date[] | null; } export default class Sample extends React.Component<{}, State> { state = { - value: new Date(), + value: null, }; onChange = (value: Date | Date[]) => {