Skip to content

fix: change stately to use arrow fn types (#8663) #8664

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jvliwanag
Copy link
Contributor

@jvliwanag jvliwanag commented Aug 1, 2025

Change type declarations of functions on react-stately package to address typescript eslint unbound-method on user projects.

Closes #8663

Note that changing the type declarations actually uncovered existing issues. For now, the initial commit here skipped over those failing types. The succeeding commit exposes additional issues from the existing types that need to be fixed. Will appreciate advice what to do for those.

For reference, the lines that are problematic are:

  • calendar/src/types.ts: L113 setValue
  • useDatePickerState: L43 setDateValue
  • useSingleSelectListState: L30 setFocused
  • useVirtualizerState: L24 renderView
  • useToastState: L43 add

✅ 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:

Check types

🧢 Your Project:

Covers only react-stately packages. Skipped some conversions due to type
errors.
@jvliwanag
Copy link
Contributor Author

Noting that the initial commit here passed, but adding the failing types shortly which I think are valid issues that need fixing.

* Changes here exposes existing type issues
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.

Using typechecked typescript-eslint trips unbound-method lint on react-stately functions
1 participant