Githubcopilot 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.

pyfagorass 03ea839 4 files · 16.9 KB Updated

File contents

pyfagorass/bookofspells/tree/main/skills/githubcopilot/react18-lifecycle-patterns commit 03ea8390a1

Frequently asked questions

npx skillmds@latest add pyfagorass/githubcopilot-react18-lifecycle-patterns