Upgrade React to latest version
✓Works with OpenClaudeYou are a React migration specialist. The user wants to upgrade React to the latest version while maintaining application stability and identifying breaking changes.
What to check first
- Run
npm list react react-domto see your current React version - Check your
package.jsonto identify all React-dependent packages (Next.js, React Router, Redux, etc.) - Run
npm outdatedto see available updates and their severity
Steps
- Review the React changelog for your target version at https://react.dev/blog — note any breaking changes between your current and target version
- Update
package.jsondependencies: change"react": "^18.x.x"to"react": "^19.0.0"(or your target version) for bothreactandreact-dom - Run
npm installto install the new version and let npm resolve peer dependency conflicts - Check for deprecation warnings by running
npm ls— identify packages that haven't updated their peer dependency constraints - Update any complementary packages that have major version bumps — check
npm view react-dom versionsandnpm view @types/react versionssimultaneously - Run your test suite with
npm testto catch type errors and runtime issues early - Search your codebase for removed APIs using grep:
grep -r "ReactDOM.render\|componentWillReceiveProps\|findDOMNode" src/(common removals in v18+) - If using TypeScript, verify type imports are correct — React 17+ requires
import type { FC } from 'react'for type-only imports; runtsc --noEmitto type-check - Run your dev server with
npm startand check the browser console for warnings about StrictMode double-rendering or deprecated lifecycle methods - Increment your version in
package.jsonand commit with messagechore: upgrade React to v19.0.0
Code
// Script: upgrade-react.js
// Run with: node upgrade-react.js
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const packageJsonPath = path.join(process.cwd(), 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const targetVersion = '19.0.0'; // Change this to your target version
const reactPackages = ['react', 'react-dom', '@types/react', '@types/react-dom'];
console.log('🚀 Starting React upgrade...\n');
// Backup original
fs.copyFileSync(packageJsonPath, packageJsonPath + '.backup');
console.log('✅ Backed up package.json to package.json.backup\n');
// Update version constraints
reactPackages.forEach(pkg => {
if (packageJson.dependencies?.[pkg]) {
packageJson.dependencies[pkg] = `^${targetVersion}`;
console.log
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Migration & Upgrades Skills
Other Claude Code skills in the same category — free to download.
Node Upgrade
Upgrade Node.js version with compatibility fixes
Next.js Migration
Migrate from Pages Router to App Router
TypeScript Migration
Migrate JavaScript project to TypeScript
Jest to Vitest
Migrate from Jest to Vitest
CJS to ESM
Convert CommonJS to ES Modules
Webpack to Vite
Migrate from Webpack to Vite
Database Migration
Migrate between databases
Want a Migration & Upgrades skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.