mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #45178 react-calendar: value prop can be null too by @giacomocerquone
* fix: value can be null too * fix: update react-calendar version in typing header * fix: add tests Co-authored-by: giacomocerquone <cerquone96@hotmail.it>
This commit is contained in:
parent
dff60ccd7d
commit
ef791359b8
4
types/react-calendar/index.d.ts
vendored
4
types/react-calendar/index.d.ts
vendored
@ -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 <https://github.com/Guymestef>, Katie Soldau <https://github.com/ksoldau>
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
@ -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[]) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user