
React18 Lifecycle Patterns
github/awesome-copilotOfficial
Migrates the three unsafe class lifecycle methods to React 18.3.1 patterns using semantic decision tables.
- skills.sh installs
- 746
- GitHub stars
- 41.4K
- last updated
- Aug 21, 2026
What it does
- Covers componentWillMount, componentWillReceiveProps, and componentWillUpdate, routing each by what the method actually does to its correct replacement
- Includes three reference files with before and after code for each lifecycle method, plus getDerivedStateFromProps trap warnings
- Enforces a rule against permanent
UNSAFE_prefixes and requires a TODO comment on any temporary prefix that is added - Designed for codebases migrating class components before a React 19 upgrade, where the right pattern depends on the method's semantics
Install
$ npx -y skills add github/awesome-copilot --skill react18-lifecycle-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React 18 Lifecycle Patterns
Reference for migrating the three unsafe class component lifecycle methods to React 18.3.1 compliant patterns.
Quick Decision Guide
Before migrating any lifecycle method, identify the semantic category of what the method does. Wrong category = wrong migration. The table below routes you to the correct reference file.
componentWillMount - what does it do?
| What it does | Correct migration | Reference |
|---|---|---|
Sets initial state (this.setState(...)) | Move to constructor | → componentWillMount.md |
| Runs a side effect (fetch, subscription, DOM) | Move to componentDidMount | → componentWillMount.md |
| Derives initial state from props | Move to constructor with props | → componentWillMount.md |
componentWillReceiveProps - what does it do?
Details
- Repository
- github.com/github/awesome-copilot
- Category
- Frontend & UI Code
- First seen
- May 16, 2026
More from github/awesome-copilot
All 293- React18 String Refs744
- React18 Enzyme To Rtl743
- Linkedin Post Formatter362
- Ui Screenshots216
- Data Breach Blast Radius110
- Sql Server Table Reconciliation106
- Aws Cloudwatch Investigation
- Aws Cost Optimize
- Aws Resource Health Diagnose
- Aws Well Architected Review
- Azure Well Architected Review
- Bug Reproduction Brief
- Incident Postmortem
- Mcp Implementation Security Review
- Pester Migration
- Tm7 Threat Model
- Git Commit48.7K
- Excalidraw Diagram Generator34.6K
- Multi Stage Dockerfile31.7K
- Documentation Writer28.6K
- Prd24.6K
- Refactor22.7K
- Java Springboot22.1K
- Create Readme19.6K
Similar to React18 Lifecycle Patterns
More Frontend & UI Code
react18-string-refsgithub/awesome-copilot744 installsMigration guide for React string refs to React.createRef() in class components, covering React 18.3.1 and React 19.
react19-source-patternsgithub/awesome-copilot995 installsMigration reference covering React 19 source-file changes, from ReactDOM API updates to ref and context rewrites.
react-modernizationwshobson/agents13.2K installsUpgrade guide for React apps covering version migrations, class-to-hooks conversion, and concurrent features.
react-19gentleman-programming/gentleman-skills270 installsReact 19 component patterns that rely on React Compiler instead of manual memoization.
frontend-react-best-practicessergiodxa/agent-skills1.2K installsReact performance rules and composition patterns covering re-renders, bundle size, and hydration pitfalls.
react-patternsaffaan-m/ecc6.4K installsReact 18/19 patterns that cover hooks discipline, RSC boundaries, Suspense, form actions, and state placement.