react-to-taro

Migrate React Web applications to Taro 4.x for WeChat Mini Programs.

3|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/dafang/taro-weapp-plugin --skill react-to-taro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-to-taro
Source: https://github.com/dafang/taro-weapp-plugin/tree/main/skills/react-to-taro
Command: npx skills add https://github.com/dafang/taro-weapp-plugin --skill react-to-taro

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the heavy lifting of migrating React Web applications into Taro 4.x codebases optimized for WeChat Mini Programs. It helps teams preserve logic while adapting UI and routing to Taro components and APIs.

Core Features & Use Cases

  • JSX & Element Mapping: div/section → View, span/p → Text, and lazy-load images.
  • Event & API Adaptation: Convert onChange to onInput and replace Web APIs with Taro equivalents.
  • Routing Migration: Replace react-router-dom patterns with Taro navigation APIs.
  • Automation Hooks: Includes analyze.js, generate-transforms.js, and validate.js to streamline the migration workflow.

Quick Start

  1. Analyze your React project: node scripts/analyze.js <path-to-src>
  2. Generate conversion directives: node scripts/generate-transforms.js taro-migration-report.json
  3. Apply transforms (by agent or manually) and validate: node scripts/validate.js <taro-path>