Skip to content

Migrate codebase to React 18#334

Draft
mirekys wants to merge 2 commits intoinveniosoftware:masterfrom
oarepo:mirekys/react-18-migration
Draft

Migrate codebase to React 18#334
mirekys wants to merge 2 commits intoinveniosoftware:masterfrom
oarepo:mirekys/react-18-migration

Conversation

@mirekys
Copy link
Copy Markdown

@mirekys mirekys commented Apr 29, 2026

❤️ Thank you for your contribution!

Description

Migrate react-invenio-forms from React 16 to React 18 following RFC inveniosoftware/rfcs#112.
This PR contains application of following codemods for v18:

  • Upgrades peer dependencies
  • Replaces enzyme adapter for React18 suppoort
  • Removes explicit React imports (update-react-imports codemod)
  • Migrates render-only class components to functions (pure-component codemod)
  • Updates entry points to createRoot (update-react-imports codemod)
  • Bumps Node - >= v22

Prerequisites

To make React 18 linting work, you need to link a local clone of eslint-config-invenio:

gh repo clone inveniosoftware/eslint-config-invenio
gh pr checkout 20
cd eslint-config-invenio
npm link

In this repo:

npm link @inveniosoftware/eslint-config-invenio

Status:

  • All tests pass

Requires:

Part of: inveniosoftware/rfcs#112

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

mirekys added 2 commits April 29, 2026 15:54
* Upgrades react and react-dom from ^16.13.0 to ^18.3.0
* Replaces enzyme-adapter-react-16 with
  @cfaester/enzyme-adapter-react-18 ^0.8.0
* Requires Node version >=22.0.0
* Applies update-react-imports codemod
* Applies pure-component codemod
* Migrates ReactDOM.render to createRoot API
@mirekys mirekys added this to v14 Apr 29, 2026
@mirekys mirekys marked this pull request as draft April 29, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant