react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Update datepicker documentation which has missing import

Open samrobbins85 opened this issue 2 years ago • 1 comments

✅ 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).
  • [x] Filled out test instructions.
  • [x] Updated documentation (if it already exists for this component).
  • [ ] Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Copy the code into an IDE and see that there is no longer an error that createCalendar is not defined

🧢 Your Project:

samrobbins85 avatar Apr 26 '23 08:04 samrobbins85

I'm not sure on the best approach for the failing type check here. It's failing because separate code blocks both contain the import, but the other import is later in the list of components, which creates initial confusion due to createCalendar not being defined. I could have only the createCalendar import in the first usage and just getWeeksInMonth in the second usage, but that could also be confusing for the second usage

samrobbins85 avatar Apr 26 '23 09:04 samrobbins85

Not all of our examples include all of the imports because that would be very repetitive. But we might be able to improve this for copy past in our upcoming work. Going to close for now.

devongovett avatar Apr 12 '25 00:04 devongovett