Use when a component needs migration to the target architecture or framework version.
67%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./packs/react/skills/migration-migrate-component/SKILL.mdMigrate a React component from class to functional with TypeScript following docs/ARCHITECTURE.md section 5.
Component: $ARGUMENTS
Read docs/ARCHITECTURE.md section 5.
Analyze the component:
Convert to functional component with TypeScript:
class X extends Component -> function X(props: XProps)this.state / this.setState -> useState()this.props -> destructured props parameterPropTypes -> TypeScript interfacecomponentDidMount -> useEffect(() => {}, [])componentDidUpdate -> useEffect(() => {}, [deps])componentWillUnmount -> useEffect cleanup functionshouldComponentUpdate -> React.memo()this.handleX.bind(this) -> useCallbackconnect, withRouter) -> custom hooks (useStore, useNavigate)connect(mapState, mapDispatch) -> Zustand selectorsApply composition pattern if there is prop drilling.
Decompose if > 200 lines.
Validate:
npx tsc --noEmit
npx vite build
npx vitest run --passWithNoTestsfernandezbaptiste/specialist-agent
cd716d9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.