ホーム
  • キャンバス
  • 画像
  • 動画
  • 音声
  • MCP / CLI
  • モデル
  • スキル
  • ツール
料金プランログイン新規登録

作成

  • AI 動画
  • AI 画像
  • 画像から動画
  • テキストから動画
  • AI 動画編集
  • 画像アップスケール
  • 画像編集

画像作成・編集

  • 画像を作成

画像モデル

  • GPT Image 2.6 Sunburst
  • GPT Image 2.6 Flare
  • GPT Image 2.5 Sunburst
  • GPT Image 2.5 Flare
  • Nano Banana 2.1

動画作成・編集

  • 動画を作成
  • エフェクト
  • 画像から動画生成
  • テキストから動画生成
  • 動画を編集
  • 動画アップスケール
  • ミックスメディア
  • 顔の入れ替え

動画モデル

  • Seedance 2.5
  • Kling 4.0
  • Kling 4.0 Flash
  • Gemini Omni Flash 1.2
  • FLUX.3 Video

オーディオ

  • テキスト読み上げ
  • ボイスチェンジ
  • 翻訳

オーディオモデル

  • Seed Audio 1.0
  • Eleven v4
  • Eleven v4 Turbo
  • Eleven v3
  • Qwen Audio 3.0

スタジオ

  • マーケティングスタジオ
  • リップシンク
  • キャンバス

プラットフォーム

  • MCP
  • CLI
  • モデル
  • モデルプロバイダー
  • スキル
  • ツール
  • ツールプロバイダー

会社情報

  • エージェントインストラクション
  • ヘルプセンター
  • 利用規約
  • プライバシー
  • 脆弱性を報告

開発者

  • ドキュメント
  • API リファレンス
  • 開発者プラットフォーム
  • AI サイトマップ
© 2026 ドットメディア株式会社 すべての権利を留保します。
すべてのスキルランキングマイリスト
業務領域
リポジトリ
スキル開発者
作業
成果物
連携サービス
呼び出し方
  1. ホーム
  2. スキル
  1. ホーム
  2. スキル
  3. SKILL.md
ファイル
wshobson
agents
.agents
.claude-plugin
.cursor
.cursor-plugin
.github
docs
evals
plugins
accessibility-compliance
agent-orchestration
agent-teams
api-scaffolding
api-testing-observability
application-performance
arm-cortex-microcontrollers
avoid-ai-writing
backend-api-security
backend-development
before-you-build
block-no-verify
blockchain-web3
brand-landingpage
business-analytics
c4-architecture
cicd-automation
cloud-infrastructure
code-documentation
code-refactoring
codebase-cleanup
comprehensive-review
conductor
content-marketing
context-management
customer-sales-automation
data-engineering
data-validation-suite
database-cloud-optimization
database-design
database-migrations
debugging-toolkit
dependency-management
deployment-strategies
ブランチタグ
c96b5f6原文を開く
Wwshobson·2026/11/24
未翻訳
328 行(空行を除く 255 行) · 6.66 KB·原文
name: react-modernization
description: Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.

React Modernization

Master React version upgrades, class to hooks migration, concurrent features adoption, and codemods for automated transformation.

When to Use This Skill

  • Upgrading React applications to latest versions
  • Migrating class components to functional components with hooks
  • Adopting concurrent React features (Suspense, transitions)
  • Applying codemods for automated refactoring
  • Modernizing state management patterns
  • Updating to TypeScript
  • Improving performance with React 18+ features

Version Upgrade Path

React 16 → 17 → 18

Breaking Changes by Version:

React 17:

  • Event delegation changes
  • No event pooling
  • Effect cleanup timing
  • JSX transform (no React import needed)

React 18:

  • Automatic batching
  • Concurrent rendering
  • Strict Mode changes (double invocation)
  • New root API
  • Suspense on server

Class to Hooks Migration

State Management

// Before: Class component
class Counter extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      count: 0,
      name: "",
    };
  }
​
  increment = () => {
    this.setState({ count: this.state.count + 1 });
  };
​
  render() {
    return (
      <div>
        <p>Count: {this.state.count}</p>
        <button onClick={this.increment}>Increment</button>
      </div>
    );
  }
}
​
// After: Functional component with hooks
function Counter() {
  const [count, setCount] = useState(0);
  const [name, setName] = useState("");
​
  const increment = () => {
    setCount(count + 1);
  };
​
  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={increment}>Increment</button>
    </div>
  );
}

Lifecycle Methods to Hooks

// Before: Lifecycle methods
class DataFetcher extends React.Component {
  state = { data: null, loading: true };
​
  componentDidMount() {
    this.fetchData();
  }
​
  componentDidUpdate(prevProps) {
    if (prevProps.id !== this.props.id) {
      this.fetchData();
    }
  }
​
  componentWillUnmount() {
    this.cancelRequest();
  }
​
  fetchData = async () => {
    const data = await fetch(`/api/${this.props.id}`);
    this.setState({ data, loading: false });
  };
​
  cancelRequest = () => {
    // Cleanup
  };
​
  render() {
    if (this.state.loading) return <div>Loading...</div>;
    return <div>{this.state.data}</div>;
  }
}
​
// After: useEffect hook
function DataFetcher({ id }) {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(true);
​
  useEffect(() => {
    let cancelled = false;
​
    const fetchData = async () => {
      try {
        const response = await fetch(`/api/${id}`);
        const result = await response.json();
​
        if (!cancelled) {
          setData(result);
          setLoading(false);
        }
      } catch (error) {
        if (!cancelled) {
          console.error(error);
        }
      }
    };
​
    fetchData();
​
    // Cleanup function
    return () => {
      cancelled = true;
    };
  }, [id]); // Re-run when id changes
​
  if (loading) return <div>Loading...</div>;
  return <div>{data}</div>;
}

Context and HOCs to Hooks

// Before: Context consumer and HOC
const ThemeContext = React.createContext();
​
class ThemedButton extends React.Component {
  static contextType = ThemeContext;
​
  render() {
    return (
      <button style={{ background: this.context.theme }}>
        {this.props.children}
      </button>
    );
  }
}
​
// After: useContext hook
function ThemedButton({ children }) {
  const { theme } = useContext(ThemeContext);
​
  return <button style={{ background: theme }}>{children}</button>;
}
​
// Before: HOC for data fetching
function withUser(Component) {
  return class extends React.Component {
    state = { user: null };
​
    componentDidMount() {
      fetchUser().then((user) => this.setState({ user }));
    }
​
    render() {
      return <Component {...this.props} user={this.state.user} />;
    }
  };
}
​
// After: Custom hook
function useUser() {
  const [user, setUser] = useState(null);
​
  useEffect(() => {
    fetchUser().then(setUser);
  }, []);
​
  return user;
}
​
function UserProfile() {
  const user = useUser();
  if (!user) return <div>Loading...</div>;
  return <div>{user.name}</div>;
}

React 18 Concurrent Features

New Root API

// Before: React 17
import ReactDOM from "react-dom";
​
ReactDOM.render(<App />, document.getElementById("root"));
​
// After: React 18
import { createRoot } from "react-dom/client";
​
const root = createRoot(document.getElementById("root"));
root.render(<App />);

Automatic Batching

// React 18: All updates are batched
function handleClick() {
  setCount((c) => c + 1);
  setFlag((f) => !f);
  // Only one re-render (batched)
}
​
// Even in async:
setTimeout(() => {
  setCount((c) => c + 1);
  setFlag((f) => !f);
  // Still batched in React 18!
}, 1000);
​
// Opt out if needed
import { flushSync } from "react-dom";
​
flushSync(() => {
  setCount((c) => c + 1);
});
// Re-render happens here
setFlag((f) => !f);
// Another re-render

Transitions

import { useState, useTransition } from "react";
​
function SearchResults() {
  const [query, setQuery] = useState("");
  const [results, setResults] = useState([]);
  const [isPending, startTransition] = useTransition();
​
  const handleChange = (e) => {
    // Urgent: Update input immediately
    setQuery(e.target.value);
​
    // Non-urgent: Update results (can be interrupted)
    startTransition(() => {
      setResults(searchResults(e.target.value));
    });
  };
​
  return (
    <>
      <input value={query} onChange={handleChange} />
      {isPending && <Spinner />}
      <Results data={results} />
    </>
  );
}

Suspense for Data Fetching

import { Suspense } from "react";
​
// Resource-based data fetching (with React 18)
const resource = fetchProfileData();
​
function ProfilePage() {
  return (
    <Suspense fallback={<Loading />}>
      <ProfileDetails />
      <Suspense fallback={<Loading />}>
        <ProfileTimeline />
      </Suspense>
    </Suspense>
  );
}
​
function ProfileDetails() {
  // This will suspend if data not ready
  const user = resource.user.read();
  return <h1>{user.name}</h1>;
}
​
function ProfileTimeline() {
  const posts = resource.posts.read();
  return <Timeline posts={posts} />;
}

Additional patterns and templates

More detailed templates and worked examples live in details.md. Read that file for the full pattern library.