From dbd5f05652bdea66530bbeb76553fa70ece869d9 Mon Sep 17 00:00:00 2001 From: jbpenrath Date: Mon, 29 Jul 2024 09:02:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F(react)=20fix=20types=20is?= =?UTF-8?q?sue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since upgrade of @react-stately/calendar, a type issue was emit and broke the build. --- .../src/components/Forms/DatePicker/CalendarCell.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react/src/components/Forms/DatePicker/CalendarCell.tsx b/packages/react/src/components/Forms/DatePicker/CalendarCell.tsx index 23f867f81..c10b604b0 100644 --- a/packages/react/src/components/Forms/DatePicker/CalendarCell.tsx +++ b/packages/react/src/components/Forms/DatePicker/CalendarCell.tsx @@ -16,7 +16,7 @@ interface CalendarCellProps { } const isRangeCalendar = (object: any): object is RangeCalendarState => { - return object?.highlightedRange; + return Boolean(object?.highlightedRange); }; export const CalendarCell = ({ state, date }: CalendarCellProps) => { @@ -31,15 +31,15 @@ export const CalendarCell = ({ state, date }: CalendarCellProps) => { } = useCalendarCell({ date }, state, ref); const isSelectionEnd = - isRangeCalendar(state) && isSameDay(date, state?.highlightedRange?.end); + isRangeCalendar(state) && isSameDay(date, state.highlightedRange!.end); const isSelectionStart = - isRangeCalendar(state) && isSameDay(date, state?.highlightedRange?.start); + isRangeCalendar(state) && isSameDay(date, state?.highlightedRange!.start); const isWithinHighlightedRange = isRangeCalendar(state) && - state?.highlightedRange?.start <= date && - state?.highlightedRange?.end >= date; + state?.highlightedRange!.start <= date && + state?.highlightedRange!.end >= date; return (