Generated banner for React19 Concurrent Patterns
Generated logo for React19 Concurrent Patterns

React19 Concurrent Patterns

GitHubOfficialFirst committed by SaravananRajaramanDistributed by GitHub

  • Skill
  • Guidelines
  • Software development
  • MIT
  • No issues found

From the author

Preserve React 18 concurrent patterns and adopt React 19 APIs (useTransition, useDeferredValue, Suspense, use(), useOptimistic, Actions) during migration.
— the description by SaravananRajaraman

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to migrating React applications to version 19. It emphasizes a two-phase strategy: first, ensuring that existing React 18 concurrent patterns remain intact and functional during the initial migration, and second, introducing new React 19 features like Actions, the use() hook, and improved Suspense patterns only after the migration is stabilized. It includes specific verification steps to prevent accidental breakage of concurrent logic.

What it does

  • Validates that existing React 18 concurrent patterns are preserved during migration.
  • Provides guidance on when to introduce new React 19 APIs.
  • Offers patterns for using React 19 Actions with useActionState and useFormStatus.
  • Demonstrates how to implement Suspense for data fetching using the use() hook.
  • Includes command-line verification to check for accidental modification of concurrent patterns.
  • Distinguishes between code-splitting and data-fetching use cases for Suspense.

When to use it

  • When planning or executing a migration from React 18 to React 19.
  • When you need to ensure concurrent mode features remain stable during a framework upgrade.
  • When you are ready to refactor legacy form handling into the new React 19 Actions pattern.
  • When adopting new data-fetching patterns using Suspense and the use() hook.

Advantages

  • Reduces the risk of breaking concurrent features during the migration process.
  • Provides a clear separation between migration stability and feature adoption.
  • Simplifies form handling by replacing complex useReducer logic with Actions.
  • Offers standardized patterns for modern data fetching and state management.

Usage examples

“How do I verify that my concurrent patterns were not broken during the React 19 migration?”
The agent provides a grep command to scan the codebase for key concurrent patterns like useTransition and useDeferredValue to ensure they remain untouched.
“Show me how to replace my React 18 form logic with React 19 Actions.”
The agent provides a side-by-side comparison showing the transition from useReducer to the useActionState hook.
“How can I use Suspense for data fetching in React 19?”
The agent explains the use() hook and provides patterns for memoizing promises to prevent unnecessary re-renders.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/github/react19-concurrent-patterns/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip react19-concurrent-patterns.zip -d .agents/skills

Documentation by SaravananRajaraman

React 19 Concurrent Patterns

React 19 introduced new APIs that complement the migration work. This skill covers two concerns:

  1. Preserve existing React 18 concurrent patterns that must not be broken during migration

  2. Adopt new React 19 APIs worth introducing after migration stabilizes

Part 1 Preserve: React 18 Concurrent Patterns That Must Survive the Migration

These patterns exist in React 18 codebases and must not be accidentally removed or broken:

createRoot Already Migrated by the R18 Orchestra

If the R18 orchestra already ran, ReactDOM.render → createRoot is done. Verify it's correct:

// CORRECT React 19 root (same as React 18):
import { createRoot } from 'react-dom/client';
const root = createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);
useTransition No Migration Needed

useTransition from React 18 works identically in React 19. Do not touch these patterns during migration:

// React 18 useTransition  unchanged in React 19:
const [isPending, startTransition] = useTransition();

function handleClick() {
  startTransition(() => {
    setFilteredResults(computeExpensiveFilter(input));
  });
}
useDeferredValue No Migration Needed
// React 18 useDeferredValue  unchanged in React 19:
const deferredQuery = useDeferredValue(query);
Suspense for Code Splitting No Migration Needed
// React 18 Suspense with lazy  unchanged in React 19:
const LazyComponent = React.lazy(() => import('./LazyComponent'));

function App() {
  return (
    <Suspense fallback={<Spinner />}>
      <LazyComponent />
    </Suspense>
  );
}

Part 2 React 19 New APIs

These are worth adopting in a post-migration cleanup sprint. Do not introduce these DURING the migration stabilize first.

For full patterns on each new API, read:

  • references/react19-use.md the use() hook for promises and context

  • references/react19-actions.md Actions, useActionState, useFormStatus, useOptimistic

  • references/react19-suspense.md Suspense for data fetching (the new pattern)

Migration Safety Rules

During the React 19 migration itself, these concurrent-mode patterns must be left completely untouched:

# Verify nothing touched these during migration:
grep -rn "useTransition\|useDeferredValue\|Suspense\|startTransition" \
  src/ --include="*.js" --include="*.jsx" | grep -v "\.test\."

If the migrator touched any of these files, review the changes the migration should only have modified React API surface (forwardRef, defaultProps, etc.), never concurrent mode logic.

Files

SKILL.md

React 19 Concurrent Patterns

React 19 introduced new APIs that complement the migration work. This skill covers two concerns:

  1. Preserve existing React 18 concurrent patterns that must not be broken during migration

  2. Adopt new React 19 APIs worth introducing after migration stabilizes

Part 1 Preserve: React 18 Concurrent Patterns That Must Survive the Migration

These patterns exist in React 18 codebases and must not be accidentally removed or broken:

createRoot Already Migrated by the R18 Orchestra

If the R18 orchestra already ran, ReactDOM.render → createRoot is done. Verify it's correct:

// CORRECT React 19 root (same as React 18):
import { createRoot } from 'react-dom/client';
const root = createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);
useTransition No Migration Needed

useTransition from React 18 works identically in React 19. Do not touch these patterns during migration:

// React 18 useTransition  unchanged in React 19:
const [isPending, startTransition] = useTransition();

function handleClick() {
  startTransition(() => {
    setFilteredResults(computeExpensiveFilter(input));
  });
}
useDeferredValue No Migration Needed
// React 18 useDeferredValue  unchanged in React 19:
const deferredQuery = useDeferredValue(query);
Suspense for Code Splitting No Migration Needed
// React 18 Suspense with lazy  unchanged in React 19:
const LazyComponent = React.lazy(() => import('./LazyComponent'));

function App() {
  return (
    <Suspense fallback={<Spinner />}>
      <LazyComponent />
    </Suspense>
  );
}

Part 2 React 19 New APIs

These are worth adopting in a post-migration cleanup sprint. Do not introduce these DURING the migration stabilize first.

For full patterns on each new API, read:

  • references/react19-use.md the use() hook for promises and context

  • references/react19-actions.md Actions, useActionState, useFormStatus, useOptimistic

  • references/react19-suspense.md Suspense for data fetching (the new pattern)

Migration Safety Rules

During the React 19 migration itself, these concurrent-mode patterns must be left completely untouched:

# Verify nothing touched these during migration:
grep -rn "useTransition\|useDeferredValue\|Suspense\|startTransition" \
  src/ --include="*.js" --include="*.jsx" | grep -v "\.test\."

If the migrator touched any of these files, review the changes the migration should only have modified React API surface (forwardRef, defaultProps, etc.), never concurrent mode logic.

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

First committed by
GitHub avatar of SaravananRajaramanSaravananRajaraman
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/react19-concurrent-patterns · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
SaravananRajaraman, stbenjam

AutoGineer is not affiliated with or endorsed by SaravananRajaraman or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download react19-concurrent-patterns.zip