mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
@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.
}
```
This commit is contained in:
Vendored
+1
-1
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user