·
Last changedVersion:
This version passed the hardening gate. Hardening applied 5 targeted changes and preserved all other text. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 5. Review findings remaining: 3.
None
None
Expand | File | Group | Subtype | Severity | Status |
|---|
No findings available
0 findings
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 ( | Move to | |
Runs a side effect (fetch, subscription, DOM) | Move to | |
Derives initial state from props | Move to |
| What it does | Correct migration | Reference |
|---|---|---|
Async side effect triggered by prop change (fetch, cancel) |
| |
Pure state derivation from new props (no side effects) |
|
| What it does | Correct migration | Reference |
|---|---|---|
Reads the DOM before update (scroll, size, position) |
| |
Cancels requests / runs effects before update |
|
Never use UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps, or UNSAFE_componentWillUpdate as a permanent fix.
Prefixing does NOT:
The UNSAFE_ prefix is only appropriate as a temporary hold while scheduling the real migration sprint. Mark any UNSAFE_ prefix additions with:
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.
Get started with chainctlchainctl skill install public/github/react18-lifecycle-patterns:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.chainreg.biz/public/github.com/github/skills/react18-lifecycle-patterns:latest
MIT
HARDENING.md
LICENSE
SKILL.md
references/componentWillMount.md
references/componentWillReceiveProps.md
references/componentWillUpdate.md