react-modernization

Migrate React class components to functional components using hooks.

4|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/AI-Foundry-Core/ril-agents --skill react-modernization-ai-foundry-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-modernization
Source: https://github.com/AI-Foundry-Core/ril-agents/tree/main/plugins/framework-migration/skills/react-modernization
Command: npx skills add https://github.com/AI-Foundry-Core/ril-agents --skill react-modernization-ai-foundry-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the modernization of legacy React codebases by converting class components to functional components with hooks, enabling upgrade to React 18 and adoption of concurrent features.

Core Features & Use Cases

  • Automated Class-to-Hooks Migration: Converts class components into functional components with proper useState, useEffect, and custom hooks.
  • React 18 Upgrade & Concurrency Adoption: Assists upgrading React and react-dom versions, the new root API, and automatic batching.
  • Codemods for Safe Refactoring: Applies codemods for mass transformations and TypeScript migration patterns.
  • Use Case: Migrate a legacy admin panel from class components to hooks and upgrade to React 18 while preserving behavior.

Quick Start

Invoke React modernization to migrate class components to hooks and upgrade to React 18 using codemods.

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?

Migrate React class components to functional components by converting lifecycle methods into useState and useEffect hooks, replacing context and HOCs with custom hooks, and applying codemods for automated mass transformations.

What's the best way to upgrade a legacy React app to React 18?

Upgrade legacy React apps to React 18 by updating react-dom versions, adopting the new root API, enabling automatic batching, and applying codemods to refactor class components into functional components with hooks.

Can I automate TypeScript migration when modernizing React codebases?

Automate TypeScript migration during React modernization by applying codemod-driven refactoring patterns that convert class components to functional components while updating type definitions and hook usage.

Does codemod-driven refactoring preserve existing behavior during class-to-hooks conversion?

Codemod-driven refactoring preserves existing behavior by safely transforming class components into functional components with proper useState, useEffect, and custom hooks while maintaining original logic and context usage.

How do React 18 concurrent features work with functional components?

React 18 concurrent features work with functional components by leveraging the new root API and automatic batching, enabling smoother rendering and updates when class components are migrated to hooks.

When should I not use automated codemods for React modernization?

Avoid automated codemods for React modernization when class components contain highly complex lifecycle interdependencies or non-standard HOC patterns that require manual review to ensure correct hooks conversion.