react-class-to-functional

Official

Modernize React codebases instantly.

Authorcockroachdb
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill automates the tedious and error-prone process of converting legacy React class components into modern functional components using hooks, improving code readability and maintainability.

Core Features & Use Cases

  • State Conversion: Transforms this.state and this.setState into useState hooks.
  • Lifecycle Hook Mapping: Converts componentDidMount, componentDidUpdate, and componentWillUnmount into useEffect hooks.
  • Ref and Context Handling: Migrates createRef to useRef and static contextType to useContext.
  • Use Case: Refactor a large React application's component library from class-based to functional components to leverage hooks for better state management and side-effect handling.

Quick Start

Use the react-class-to-functional skill to convert the file '/path/to/MyClassComponent.tsx'.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: react-class-to-functional
Download link: https://github.com/cockroachdb/cockroach/archive/main.zip#react-class-to-functional

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.