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

Upgrade to React v19 #1113

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Upgrade to React v19 #1113

wants to merge 14 commits into from

Conversation

meissadia
Copy link
Contributor

@meissadia meissadia commented Jan 21, 2025

Closes #1104

TODO

  • Address linter errors

Summary

  • Components in DSR running React v19 are functional but Storybook v7 seems to break. Working through that here.
  • Integration of DSR running React v19 is functionally successful (all E2E tests pass)

Changes

  • Upgrade to React v19 (update imports, remove usage of defaultProps)
  • Upgrade to Yarn v4
  • Upgrade to Keycloak v26
  • Upgrade to ReactQuery v5
  • Update Playwright

Issues

  • Snapshot testing fails due to extensive, but seemingly insignificant, differences (may need to switch to Element snapshots instead of Full page snapshots for more consistent rendering?).

Next steps

How to test this PR

  1. yarn && yarn playwright install && yarn test:e2e --headless

Steps taken to upgrade to React v19

  1. npx react-codemod update-react-imports
    1. Error: did not recognize object of type "TSSatisfiesExpression" while attempting to process the following files, but none seem to have any codemods that need to be applied.
    • src/api/requests/submitUserProfileFi.ts
    • src/api/requests/submitUpdateFinancialProfile.ts
    • src/components/CommonLinks.tsx
  2. yarn add --exact react@^19.0.0 react-dom@^19.0.0
  3. yarn add --exact @types/react@^19.0.0 @types/react-dom@^19.0.0
    • If the above fails to update versions, manually update package.json
  4. npx codemod@latest react/19/migration-recipe
    • No changes
  5. npx types-react-codemod@latest preset-19 ./
    • Lots of updates to import type JSX
    • Our linter automatically removes these updates as "unecessary" ex. ReactElement<any> => ReactElement
  6. Manually applied: useRef requires an argument
    1. https://react.dev/blog/2024/04/25/react-19-upgrade-guide#useref-requires-argument
  7. Upgrade yarn (4.6.0): yarn set version stable
  8. Remove deprecated usage of FunctionalComponent.defaultProps
  9. Upgrade DSR to React 19

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.

[Explore] Upgrade to React v19
1 participant