Skip to content

Commit

Permalink
Fixed #2057 - calendar component type null issue (#2053)
Browse files Browse the repository at this point in the history
I m following this demo    [https://codesandbox.io/s/hejhs?file=/src/demo/CalendarDemo.tsx:2121-2154](url)   which contains some errors  in all    setDate hooks  like this one  setDate8(e.value) 

 here is the error description 

 CalendarChangeParams.value: Date | Date[] | null | undefined
Argument of type 'Date | Date[] | null | undefined' is not assignable to parameter of type 'SetStateAction<Date | Date[] | undefined>'.
  Type 'null' is not assignable to type 'SetStateAction<Date | Date[] | undefined>'.ts(2345)

when I check the declaration file of the calendar component I found that the interface CalendarChangeParams contains the value propriety which may have a null I tried to change this and I removed the null option it works fine so thank you,  for verifying this issue.
  • Loading branch information
TrabelsiHoussem authored Jun 6, 2021
1 parent 4c7f988 commit 64c750a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/calendar/Calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface CalendarChangeTargetOptions {

interface CalendarChangeParams {
originalEvent: React.SyntheticEvent;
value: Date | Date[] | undefined | null;
value: Date | Date[] | undefined;
stopPropagation(): void;
preventDefault(): void;
target: CalendarChangeTargetOptions;
Expand Down

0 comments on commit 64c750a

Please sign in to comment.