From react18-upgrade
Migrates unsafe React class lifecycle methods (componentWillMount, componentWillReceiveProps, componentWillUpdate) to React 18.3.1 patterns using decision trees for getDerivedStateFromProps, componentDidUpdate, getSnapshotBeforeUpdate.
npx claudepluginhub passelin/marketplace-test --plugin react18-upgradeThis skill uses the workspace's default tool permissions.
Reference for migrating the three unsafe class component lifecycle methods to React 18.3.1 compliant patterns.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Analyzes competition with Porter's Five Forces, Blue Ocean Strategy, and positioning maps to identify differentiation opportunities and market positioning for startups and pitches.
Reference for migrating the three unsafe class component lifecycle methods to React 18.3.1 compliant patterns.
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.
| 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 |
| What it does | Correct migration | Reference |
|---|---|---|
| Async side effect triggered by prop change (fetch, cancel) | componentDidUpdate | → componentWillReceiveProps.md |
| Pure state derivation from new props (no side effects) | getDerivedStateFromProps | → componentWillReceiveProps.md |
| What it does | Correct migration | Reference |
|---|---|---|
| Reads the DOM before update (scroll, size, position) | getSnapshotBeforeUpdate | → componentWillUpdate.md |
| Cancels requests / runs effects before update | componentDidUpdate with prev comparison | → componentWillUpdate.md |
Never use UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps, or UNSAFE_componentWillUpdate as a permanent fix.
Prefixing suppresses the React 18.3.1 warning but does NOT:
The UNSAFE_ prefix is only appropriate as a temporary hold while scheduling the real migration sprint. Mark any UNSAFE_ prefix additions with:
// TODO: React 19 will remove this. Migrate before React 19 upgrade.
// UNSAFE_ prefix added temporarily - replace with componentDidMount / getDerivedStateFromProps / etc.
Read the full reference file for the lifecycle method you are migrating:
references/componentWillMount.md - 3 cases with full before/after codereferences/componentWillReceiveProps.md - getDerivedStateFromProps trap warnings, full examplesreferences/componentWillUpdate.md - getSnapshotBeforeUpdate + componentDidUpdate pairingRead the relevant file before writing any migration code.