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

feat: Support React 19 #93

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: Support React 19 #93

wants to merge 1 commit into from

Conversation

avinashbot
Copy link
Member

@avinashbot avinashbot commented Jan 6, 2025

Issue #, if available: AWSUI-60250

Description of changes:

Adds React 19 as a supported peer dependency. Tested locally by updating react and @types/react to 19.0.0 and seeing if it complains about anything (see next paragraph). The two considerations of note were:

  1. Removal of non-mutable refs. For us, this means that React.RefObject<T> goes from { readonly current: T | null } to { current: T }, which means we need to include the null alternative ourselves. Adding a | null here should be backwards compatible, but this is a change to the interfaces that needs to be called out.
  2. Improved useReducer typings. React's migration guidelines of "not to pass type arguments to useReducer" is correct, but I had to make some small changes to make sure this also worked in earlier versions.

We've gotta have a talk about the growing number of React version permutations we somehow have to test against. Currently, this added support is untested (outside of my local testing before I made this PR). Should we have some kind of script to rerun unit tests against different versions of React? I don't feel so confident about a single test suite (in any of our packages) covering four major versions over five years of React releases.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.

1 participant