-
Notifications
You must be signed in to change notification settings - Fork 5
Description
User Story
As a software developer,
I want to update the deprecated ReactDOM.render method to createRoot in our React application
so that the application can leverage React 18+ features like concurrent rendering and remains compatible with future updates.
Background
React 18 deprecated ReactDOM.render in favor of createRoot to enable concurrent rendering capabilities. The current implementation in frontend/src/index.js uses the outdated method, which may block upgrades to newer React versions and prevent the use of modern features. The frontend’s package.json currently specifies React 17.0.2, so dependencies will also need updating to React 18+. Failing to address this could lead to technical debt and compatibility issues. The Docker setup for the frontend mounts the src directory, so changes to index.js will reflect without a full rebuild.
Acceptance Criteria
- Modify
frontend/src/index.jsto replaceReactDOM.renderwithcreateRootas per React 18+ syntax. - Update
reactandreact-domversions infrontend/package.jsonto at least 18.2.0. - Ensure the React application renders correctly after the update, with no console errors or warnings.
- Validate that the Docker-mounted volume for
frontend/srcreflects the changes without requiring a full container rebuild. - Confirm the API fetch in
frontend/src/App.jsstill successfully retrieves data from the backend after the update. - Test the application by running
npm startlocally and viadocker-compose upto verify consistent behavior.