react-class-to-functional
OfficialModernize 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.stateandthis.setStateintouseStatehooks. - Lifecycle Hook Mapping: Converts
componentDidMount,componentDidUpdate, andcomponentWillUnmountintouseEffecthooks. - Ref and Context Handling: Migrates
createReftouseRefandstatic contextTypetouseContext. - 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 requiredComponents
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.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.