Skip to content

feat: upgrade to React 19#307

Merged
andeplane merged 5 commits intomainfrom
feat/react-19-upgrade
Feb 26, 2026
Merged

feat: upgrade to React 19#307
andeplane merged 5 commits intomainfrom
feat/react-19-upgrade

Conversation

@andeplane
Copy link
Owner

Supersedes dependabot PRs #277 and #278. Upgrades react, react-dom, @types/react, @types/react-dom to v19, and @testing-library/react to v16 for compatibility. Fixes all breaking changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @andeplane, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant version bump for the core React libraries and their associated type definitions. The primary goal is to bring the project up to the latest React 19 standard, which also necessitated an update to the testing library to maintain compatibility. This upgrade ensures the application benefits from the newest features, performance improvements, and bug fixes introduced in React 19, while also addressing any breaking changes that arose during the transition.

Highlights

  • React 19 Upgrade: Upgraded react and react-dom to version 19.0.0, along with their corresponding TypeScript type definitions (@types/react, @types/react-dom) to 19.0.0.
  • Testing Library Update: Updated @testing-library/react to version 16.0.0 to ensure compatibility with React 19.
  • Dependency Resolution: Resolved various breaking changes and updated transitive dependencies in package-lock.json to align with the new React ecosystem, including updates to Babel helper utilities, RC components, and scheduler.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • package-lock.json
    • Updated react from 18.3.1 to 19.2.4, removing its loose-envify dependency.
    • Updated react-dom from 18.3.1 to 19.2.4, updating its scheduler dependency and react peer dependency, and removing its loose-envify dependency.
    • Updated @types/react from 18.3.27 to 19.2.14 and removed its @types/prop-types dependency.
    • Updated @types/react-dom from 18.3.7 to 19.2.3 and updated its @types/react peer dependency.
    • Updated @testing-library/react from 15.0.7 to 16.3.2, adjusting its peer dependencies to support React 19.
    • Updated scheduler from 0.23.2 to 0.27.0, removing its loose-envify dependency.
    • Updated @babel/helper-plugin-utils from 7.27.1 to 7.28.6.
    • Updated @babel/plugin-syntax-jsx from 7.27.1 to 7.28.6.
    • Updated @rc-component/async-validator from 5.0.4 to 5.1.0.
    • Updated @rc-component/trigger from 2.3.0 to 2.3.1.
    • Updated rc-segmented from 2.7.0 to 2.7.1.
    • Removed loose-envify as a direct dependency from several packages.
    • Added peer: true flag to several node_modules entries including @testing-library/dom, @types/aria-query, ansi-regex, dom-accessibility-api, lz-string, pretty-format, ansi-styles, and react-is.
  • package.json
    • Updated react from ^18.2.0 to ^19.0.0.
    • Updated react-dom from ^18.2.0 to ^19.0.0.
    • Updated @types/react from ^18.2.0 to ^19.0.0.
    • Updated @types/react-dom from ^18.2.0 to ^19.0.0.
    • Updated @testing-library/react from ^15.0.7 to ^16.0.0.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades React and related dependencies to version 19. While the direct dependency updates appear correct, I've identified several other dependencies in your project that are not compatible with React 19. This will likely lead to runtime errors. The most critical incompatibility is with react-fetch-hook. Please address these compatibility issues before merging.

Anders Hafreager and others added 4 commits February 26, 2026 13:33
react-fetch-hook@1.9.5 does not support React 19, causing `npm ci` to
fail with ERESOLVE. The package was not imported anywhere in the
codebase, so removing it is safe.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
React 19 requires an explicit initial value for useRef. Changed
useRef<Particles>() and useRef<Bonds>() to useRef<Particles | null>(null)
and useRef<Bonds | null>(null), and updated assignments to convert
undefined to null via nullish coalescing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@andeplane
Copy link
Owner Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully upgrades the project to React 19 and Styled Components v6, along with their associated dependencies. This is a significant and beneficial update, bringing the project up-to-date with the latest versions of these core libraries. The changes in package-lock.json reflect the new dependency tree, including the removal of several packages that are no longer needed, which can lead to a leaner build. The adjustments in src/containers/View.tsx to use null instead of undefined for useRef initial values and assignments improve type clarity and maintainability.

"react-fetch-hook": "^1.9.5",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-iframe": "^1.8.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The react-fetch-hook package has been removed. Please confirm that its functionality is either no longer required or has been successfully replaced by alternative implementations within the codebase. This is a functional change that should be verified to ensure no regressions.

@andeplane andeplane merged commit 9dd7751 into main Feb 26, 2026
2 checks passed
@andeplane andeplane deleted the feat/react-19-upgrade branch February 26, 2026 13:26
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