Skip to content
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

Merged

Conversation

ishank-s
Copy link
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@ishank-s
Copy link
Member Author

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;
Copy link
Member Author

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) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks icky

@ishank-s ishank-s changed the title fix types ts-strict calender fix types Apr 15, 2024
@snowystinger
Copy link
Member

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.

@ishank-s ishank-s marked this pull request as draft April 25, 2024 13:06
@ishank-s ishank-s marked this pull request as ready for review April 25, 2024 13:06
@ishank-s ishank-s closed this Apr 25, 2024
@ishank-s ishank-s reopened this Apr 25, 2024
@ishank-s
Copy link
Member Author

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

@snowystinger
Copy link
Member

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.

@snowystinger snowystinger merged commit 8cbc612 into adobe:ts-strict-calendar-state May 13, 2024
21 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants