/react18-upgrade:react18-dep-compatibilityfrom react18-upgrade
Reviews React 18.3.1 and React 19 dependency compatibility before npm installs, resolving peer-dependency conflicts and planning upgrades. Covers minimum versions for testing, Apollo, and react-router v5 to v6 migration.
Ships in react18-upgrade. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Review this matrix before npm install. Map installed React ecosystem packages to the minimum versions known to work with React 18.3.1 or React 19, then recommend safe upgrade, migration, or documented peer-dependency exception paths without hiding real concurrent-rendering risks.
package.json, lockfiles, and npm conflict output before recommending versions.--legacy-peer-deps.react-router v5 to v6 as a SEPARATE migration sprint, not a peer-dependency cleanup.references/apollo-details.md for Apollo concurrent mode and MockedProvider changes when Apollo is present.references/router-migration.md before changing route definitions or navigation code.| Package | React 17 current | React 18.3.1 minimum | React 19 minimum | Notes |
|---|---|---|---|---|
react | 17.x | 18.3.1 | 19.0.0 | Pin exactly to 18.3.1 for the R18 orchestra. |
react-dom | 17.x | 18.3.1 | 19.0.0 | Must match react exactly. |
| Area | Package | React 18 minimum | React 19 minimum | Compatibility rule |
|---|---|---|---|---|
| Testing | @testing-harness/github-copilot/react | 14.0.0 | 16.0.0 | RTL 13 uses ReactDOM.render internally and is broken for React 18 roots. |
| Testing | @testing-harness/github-copilot/jest-dom | 6.0.0 | 6.0.0 | v5 works in many cases, but v6 carries React 18 matcher updates. |
| Testing | @testing-harness/github-copilot/user-event | 14.0.0 | 14.0.0 | v13 is mostly sync; v14 is async and requires await user.click(...). |
| Testing | jest | 27.x | 27.x | Use Jest 27+ with jsdom 16+ for React 18. |
| Testing | jest-environment-jsdom | 27.x | 27.x | Keep this package aligned with jest. |
| Apollo | @apollo/client | 3.8.0 | 3.11.0 | 3.8 adds useSyncExternalStore for concurrent mode. |
| Apollo | graphql | 15.x | 16.x | Apollo 3.8+ peers allow GraphQL 15 or 16; verify installed peer range. |
| Emotion | @emotion/react | 11.10.0 | 11.13.0 | 11.10 adds React 18 concurrent mode support. |
| Emotion | @emotion/styled | 11.10.0 | 11.13.0 | Match @emotion/react. |
| Emotion | @emotion/cache | 11.10.0 | 11.13.0 | Upgrade when used directly. |
| Router | react-router-dom | v6.0.0 | v6.8.0 | v5 to v6 is breaking; read references/router-migration.md. |
| Router | react-router-dom v5 | 5.3.4 workaround | Not supported | Legacy peer workaround only; not a React 19 path. |
| Redux | react-redux | 8.0.0 | 9.0.0 | v7 works only on legacy roots and can break concurrent mode. |
| Redux | redux | 4.x | 5.x | Redux core is framework-agnostic; react-redux is the key package. |
| Redux | @reduxjs/toolkit | 1.9.0 | 2.0.0 | RTK 1.9 is tested against React 18. |
| Data fetching | react-query / @tanstack/react-query | 4.0.0 | 5.0.0 | v3 does not support concurrent mode. |
| Forms | react-hook-form | 7.0.0 | 7.43.0 | v6 has concurrent mode issues. |
| Forms | formik | 2.2.9 | 2.4.0 | v2.2.9 patched React 18 issues. |
| UI input | react-select | 5.0.0 | 5.8.0 | v4 commonly conflicts with React 18 peers. |
| Date input | react-datepicker | 4.8.0 | 6.0.0 | v4.8+ added React 18 support. |
| Drag/drop | react-dnd | 16.0.0 | 16.0.0 | v15 and below have React 18 concurrent mode issues. |
| Runtime types | prop-types | any | any | Standalone package; unaffected by React version. |
npm ls shows peer conflict for package X
│
▼
Does package X have a version that supports the target React version?
YES → install X@<min-compatible-version> and rerun npm install
NO ↓
│
Is package X critical to the app?
YES → check GitHub issues for a React 18/19 `branch/fork`, or maintainer PR
→ last resort: --legacy-peer-deps with documented reason
NO → remove or replace the package
Use npm ls <package>, npm explain <package>, and the lockfile to find the real peer owner before changing top-level dependencies.
--legacy-peer-deps rulesOnly use --legacy-peer-deps when all of these are true:
package.json comments where allowed by tooling, or in MIGRATION.md, with the package name, conflict, risk, and removal plan.Never use --legacy-peer-deps to skip Testing Library, Apollo, Redux, router, or ReactDOM API incompatibilities that have known migration paths.
| Resource | Use when |
|---|---|
references/apollo-details.md | Apollo Client, MockedProvider, cache, or concurrent mode behavior is in scope. |
references/router-migration.md | Any react-router-dom v5 to v6 route, hook, redirect, or navigation change is in scope. |
@testing-harness/github-copilot/user-event v14 actions are async; update tests with await.Switch, Redirect, route props, and history patterns need code changes.## React dependency compatibility result
**Status:** compatible | changes required | blocked
**Target React version:** React 18.3.1 | React 19
**Package manager evidence:** `<package.json / lockfile / npm output reviewed>`
| Package | Current | Required minimum | Action | Reason |
| --- | --- | --- | --- | --- |
| `<package>` | `<version>` | `<version>` | upgrade | <compatibility reason> |
### Exceptions
- `<package>`: `--legacy-peer-deps` allowed | not allowed — <reason and removal plan>
react and react-dom are pinned to the same target version.--legacy-peer-deps is recommended only with a documented package-specific reason.react-router-dom v5 to v6 work is called out as a separate migration when present.## Output template exactly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
react-upgrade, peer-dependencies, npm, dependency-matrix, react-router
npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin react18-upgrade7 skills in this plugin
/react18-batching-patternsDiagnose and fix React 18 automatic batching regressions in class components. Use when multiple setState calls occur after await, inside setTimeout, Promise .then() or .catch(), native addEventListener callbacks, or when tests fail because they assert intermediate state after a React 18 upgrade./react18-enzyme-to-rtlRewrite Enzyme tests for React 18 into React Testing Library behavior tests. Use when a test imports enzyme, uses shallow, mount, wrapper.find(), wrapper.simulate(), wrapper.prop(), wrapper.state(), wrapper.instance(), Enzyme configure/Adapter, or needs React 18-compatible RTL migration patterns./react18-legacy-contextMigrate React legacy context API usage from contextTypes, childContextTypes, and getChildContext to modern createContext. Use this skill when touching legacy context in class or function components because provider and every consumer must be updated together to avoid React 18 warnings and React 19 runtime failures./react18-lifecycle-patternsMigrate unsafe React class component lifecycle methods to React 18.3.1-safe patterns. Use when fixing `componentWillMount`, `componentWillReceiveProps`, `componentWillUpdate`, `UNSAFE_` lifecycle warnings, choosing `getDerivedStateFromProps` versus `componentDidUpdate`, or adding `getSnapshotBeforeUpdate`./react18-string-refsMigrate React string refs, ref="name" assignments, and this.refs.name access to React.createRef(), callback refs, or child ref forwarding. Use this skill when migrating React 18.3.1 warnings or React 19 removals involving single refs, multiple refs, list refs, callback refs, or refs passed to child components./react-audit-grep-patternsProvide verified grep command libraries for React 18.3.1 and React 19 migration audits, including deprecated APIs, removed APIs, unsafe lifecycle methods, batching risks, tests, dependencies, and peer conflicts. Use this skill when writing or running React migration audit scan commands.Other plugins' skills for the same job