Skip to main content

react18-lifecycle-patterns

Provides exact before/after migration patterns for the three unsafe class component lifecycle methods - componentWillMount, componentWillReceiveProps, and componentWillUpdate - targeting React 18.3.1. Use this skill whenever a class component needs its lifecycle methods migrated, when deciding between getDerivedStateFromProps vs componentDidUpdate, when adding getSnapshotBeforeUpdate, or when fixing React 18 UNSAFE_ lifecycle warnings. Always use this skill before writing any lifecycle migration code - do not guess the pattern from memory, the decision trees here prevent the most common migration mistakes.

Stars
34,159
Source
github/awesome-copilot
Updated
2026-05-29
Slug
github--awesome-copilot--react18-lifecycle-patterns
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/github/awesome-copilot/HEAD/plugins/react18-upgrade/skills/react18-lifecycle-patterns/SKILL.md -o .claude/skills/react18-lifecycle-patterns.md

Drops the SKILL.md into .claude/skills/react18-lifecycle-patterns.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.