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

React Spectrum: Compat with React 19 types #1

Closed
wants to merge 8 commits into from
Closed

Conversation

eps1lon
Copy link
Owner

@eps1lon eps1lon commented Mar 24, 2024

Closes eps1lon/DefinitelyTyped#30

Changes

  • A forwardRef render function was used as a component. This was a bug that couldn't be caught with types but now is. Previously the types assumed the second argument was legacy context. The fix was to wrap the render function in forwardRef: 1f9935a (#1)
  • breaking changes due to useReducer type parameters. The manual change is quite trivial and I never found more than one issue per repo. Still, worth a codemod but low pri: :New useReducer typings types-react-codemod#375
  • Storybook story fns were being used as components. They matched component types in React 18 since the second argument was treated as legacy context. The fix was always to use them as StoryFn(propsLike) instead of <StoryFn {...propsLike} />. I only illustrated the migration in one callsite: 48971e8 (#1). There are too many to do manually. Worth to codemod this but I'm not working on it.
  • relied on createFactory types without a need: d566212 (#1)

Unresolved issues

@eps1lon eps1lon marked this pull request as ready for review March 24, 2024 16:26
@eps1lon eps1lon self-assigned this Mar 24, 2024
@eps1lon
Copy link
Owner Author

eps1lon commented Mar 24, 2024

Remaining failures are due to 3rd party library and misuse of Story fns from Storybook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

React 19 and React Aria
1 participant