react-modernization

Migrate React class components to functional components with Hooks.

6|2|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/amurata/cc-tools --skill react-modernization-amurata
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-modernization
Source: https://github.com/amurata/cc-tools/tree/main/plugins/framework-migration/skills/react-modernization
Command: npx skills add https://github.com/amurata/cc-tools --skill react-modernization-amurata

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the process of upgrading React applications, migrating complex class components to modern functional components with Hooks, and adopting advanced features like concurrent rendering.

Core Features & Use Cases

  • Version Upgrades: Guides through breaking changes and migration paths for React 17 and 18.
  • Class to Hooks Migration: Provides code examples and strategies for converting state, lifecycle methods, and context usage.
  • Concurrent Features: Demonstrates the use of createRoot, automatic batching, Transitions, and Suspense.
  • Codemod Automation: Offers commands and examples for using jscodeshift to automate refactoring tasks.
  • TypeScript Migration: Shows how to add types to React components and props.

Quick Start

Use the react-modernization skill to help migrate a React 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?

To migrate React class components to functional components with Hooks, you replace lifecycle methods and state initialization with Hooks like useState and useEffect. This Skill provides code examples and strategies for converting complex class state, lifecycle methods, and context usage into modern functional patterns.

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

The best way to upgrade to React 18 involves navigating breaking changes and adopting the new concurrent rendering features. This Skill guides you through the migration path, demonstrating how to use createRoot, enable automatic batching, and implement Suspense and Transitions for a smooth transition.

Can I automate React migration refactoring tasks using codemods?

Yes, you can automate React migration refactoring tasks using codemods. This Skill offers commands and practical examples for using jscodeshift to automatically refactor your codebase, significantly reducing manual effort when converting class components and updating legacy React patterns.

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

To add TypeScript types to React components and props, you define interfaces for your props and type your component signatures. This Skill demonstrates how to integrate TypeScript during your modernization process, ensuring your functional components and Hooks are fully typed.

What are React concurrent features and when do I need them?

React concurrent features like Suspense and Transitions allow your application to render complex UIs without blocking the main thread. You need them when upgrading to React 18 to improve performance through automatic batching and concurrent rendering patterns.