From 41c9ec7fb5a4964ee3f24acc0c55bc6978c8d44f Mon Sep 17 00:00:00 2001 From: Tyler Jones Date: Thu, 23 Mar 2017 10:58:10 -0700 Subject: [PATCH] @types/react-dates: Add `null` as valid value for FocusedInputShape React dates accepts but more importantly returns `null` as a valid focused state. Not having this in the typings allows unexpected errors when using `strictNulls` checking. ```typescript if (focusedInput !== undefined) { // focusedInput input could be null here, but the type system does not acknowledge that. } ``` --- react-dates/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-dates/index.d.ts b/react-dates/index.d.ts index e3ca801887..863bb6e453 100644 --- a/react-dates/index.d.ts +++ b/react-dates/index.d.ts @@ -18,7 +18,7 @@ declare namespace momentPropTypes{ declare namespace ReactDates{ type AnchorDirectionShape = 'left' | 'right'; - type FocusedInputShape = 'startDate' | 'endDate'; + type FocusedInputShape = 'startDate' | 'endDate' | null; type OrientationShape = 'horizontal' | 'vertical'; type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable';