New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-strict calender fix types #6201
ts-strict calender fix types #6201
Conversation
for #6076 cc- @snowystinger |
@@ -177,7 +184,7 @@ export function useRangeCalendarState<T extends DateValue = DateValue>(props: Ra | |||
}; | |||
} | |||
|
|||
function makeRange(start: DateValue, end: DateValue): RangeValue<CalendarDate> { | |||
function makeRange(start: DateValue, end: DateValue): RangeValue<CalendarDate>|null { | |||
if (!start || !end) { | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO null should not be used in most cases, since '?' operator of ts does not recognise it
end: convertValue(range.end, value?.end) | ||
}); | ||
let range = makeRange(anchorDate, previousAvailableConstrainedDate); | ||
if (range) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks icky
Thanks for your patience. Looks like we've got some failing tests. I'll try to get some time to look into it soon if you don't figure it out before me. Thanks for having a go at this, you've already been incredibly helpful. |
hi @snowystinger , fixed the test but these failing jobs im not getting. reactDom.render is not a fn not sure what the issue in this one is |
Thank you and I apologize for a longer wait, I've had to take off for some personal reasons. I'll be back in the next week or two. |
8cbc612
into
adobe:ts-strict-calendar-state
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: