Upgrade from React 17 to React 19#16
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Conversation
- Update react and react-dom from ^17.0.2 to ^19.0.0 - Update @testing-library/react from ^12.1.4 to ^16.0.0 - Update @testing-library/user-event from ^13.5.0 to ^14.5.0 - Update react-scripts from 5.0.0 to 5.0.1 - Migrate entry point from ReactDOM.render() to createRoot() API Co-Authored-By: shahmir.masood <shahmir.masood@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
react-transition-group's CSSTransition internally uses ReactDOM.findDOMNode which was removed in React 19. Adding nodeRef prop to all CSSTransition usages bypasses findDOMNode and provides the DOM node directly via ref. Co-Authored-By: shahmir.masood <shahmir.masood@cognition.ai>
Author
End-to-End Test ResultsRan the app locally on React 19 and tested all core functionality via browser UI. Escalation: Initial testing revealed a Game Flow (Primary Test)
Settings Modal
Bug Found & Fixed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the project from React 17 (
^17.0.2) to React 19 (^19.0.0), including all necessary dependency updates, entry point migration, and compatibility fixes.Changes
Dependencies updated in
package.json:react:^17.0.2→^19.0.0react-dom:^17.0.2→^19.0.0@testing-library/react:^12.1.4→^16.0.0(React 19 compatible)@testing-library/user-event:^13.5.0→^14.5.0(compatible with @testing-library/react v16)react-scripts:5.0.0→5.0.1Entry point migration (
src/index.js):ReactDOM.render()withcreateRoot()API (React 18+ requirement)react-domtoreact-dom/clientfindDOMNoderemoval fix (Modal.jsx,Alert.jsx):react-transition-group'sCSSTransitioninternally usedReactDOM.findDOMNode, which was removed in React 19nodeRefprop to allCSSTransitionusages to bypassfindDOMNodeand provide DOM nodes directly via refsDeprecated API audit:
componentWillMount,componentWillReceiveProps,componentWillUpdate,defaultPropson function components, string refs, legacy Context API)Build verification:
Review & Testing Checklist for Human
npm startand verify the game loads without runtime errors (thefindDOMNodefix is critical)Notes
App.test.jsxwas already failing onmainbefore this upgrade (it's a leftover CRA template test that looks for "learn react" text and doesn't wrapAppinAlertProvider). This is a pre-existing issue, not introduced by this upgrade.react-countdown,react-transition-group, andreact-iconsare compatible with React 19 at their current versions and did not need upgrading.nodeRefapproach is the recommended migration path forreact-transition-groupwith React 19 (see react-transition-group docs).Link to Devin session: https://app.devin.ai/sessions/e261f82023d04ca2b4405a7826756838
Requested by: @shahmir-masood
Devin Review