react-modernization

Upgrade React versions and migrate class components to hooks.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/itsimonfredlingjack/ELECTRON-prompt-builder --skill react-modernization-itsimonfredlingjack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-modernization
Source: https://github.com/itsimonfredlingjack/ELECTRON-prompt-builder/tree/main/.cursor/skills/react-modernization
Command: npx skills add https://github.com/itsimonfredlingjack/ELECTRON-prompt-builder --skill react-modernization-itsimonfredlingjack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the challenges of updating legacy React applications, migrating complex class components to modern functional components with hooks, and adopting the latest performance-enhancing features of React 18+.

Core Features & Use Cases

  • Version Upgrades: Guides through React 16, 17, and 18 version changes, including breaking changes and new APIs.
  • Class to Hooks Migration: Provides clear before-and-after examples for converting state management, lifecycle methods, and context/HOC patterns to hooks.
  • Concurrent Features: Explains and demonstrates React 18's automatic batching, transitions, and Suspense for data fetching.
  • Codemod Automation: Offers commands to run jscodeshift for automated refactoring and codemod application.
  • TypeScript Migration: Shows how to add types to React components and props.
  • Performance Optimization: Details the use of useMemo, useCallback, and code splitting.
  • Use Case: Refactor a large, older React codebase to leverage React 18's concurrent features for improved user experience and performance, and migrate all class components to functional components using hooks.

Quick Start

Use the react-modernization skill to migrate a class component named 'UserProfile' to a functional component using hooks.

Frequently Asked Questions about react-modernization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate React class components to functional components with hooks?

Migrating React class components to functional components with hooks involves converting state management, lifecycle methods, and context or HOC patterns into hook equivalents. This Skill provides clear before-and-after examples to guide the refactoring process.

What is the best way to upgrade my legacy React application to React 18?

Upgrading legacy React applications to React 18 requires navigating breaking changes and adopting new APIs. This Skill guides version upgrades from React 16 and 17, facilitating automated refactoring using codemods to ensure a smooth transition.

How does React 18 automatic batching and Suspense work for data fetching?

React 18 automatic batching groups multiple state updates into a single re-render, while Suspense handles data fetching by pausing component rendering until data resolves. This Skill explains and demonstrates these concurrent features.

Can I use codemods to automate refactoring for my React migration?

Yes, you can automate refactoring during your React migration using codemods. This Skill offers commands to run jscodeshift, enabling automated application of codemods to efficiently upgrade versions and convert class components.

How do I add TypeScript types to existing React components and props?

Adding TypeScript types to existing React components and props involves defining interfaces for component inputs and state. This Skill supports TypeScript migration to improve type safety across your modernized functional components.

When should I use useMemo and useCallback for React performance optimization?

Use useMemo and useCallback for React performance optimization to prevent unnecessary re-renders and expensive recalculations. This Skill details these hooks alongside code splitting to enhance application performance.