Add `UNSAFE_` prefix to React deprecated lifecycle methods
Categories
(DevTools :: General, task, P3)
Tracking
(firefox103 fixed)
| Tracking | Status | |
|---|---|---|
| firefox103 | --- | fixed |
People
(Reporter: ladybenko, Assigned: tetsuharu)
References
(Blocks 2 open bugs)
Details
Attachments
(11 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 1508688 - Add `UNSAFE_` prefix to React deprecated lifecycle methods in devtools/client/shared/.
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
| Reporter | ||
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Comment 2•7 years ago
•
|
||
(In reply to Belén [:ladybenko] from comment #1)
As a note, on React 17 these methods will still exist, but with a
UNSAFE_
prefix.
Actually, they will be removed in 17.0... here is the migration path:
- 16.3: Introduce aliases for the unsafe lifecycles, UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps, and UNSAFE_componentWillUpdate. (Both the old lifecycle names and the new aliases will work in this release.)
- A future 16.x release: Enable deprecation warning for componentWillMount, componentWillReceiveProps, and componentWillUpdate. (Both the old lifecycle names and the new aliases will work in this release, but the old names will log a DEV-mode warning.)
- 17.0: Remove componentWillMount, componentWillReceiveProps, and componentWillUpdate . (Only the new “UNSAFE_” lifecycle names will work from this point forward.)
Comment 3•7 years ago
|
||
As you say in the last bullet point Only the new “UNSAFE_” lifecycle names will work from this point forward. So that's the same as what :ladybenko said in comment #1
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
| Assignee | ||
Comment 4•4 years ago
|
||
Probably we can use this script to rename them
https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles
| Assignee | ||
Comment 5•4 years ago
|
||
(In reply to Tetsuharu OHZEKI [:tetsuharu] (UTC+9) from comment #4)
Probably we can use this script to rename them
https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles
This script works well.
I'll take this.
| Assignee | ||
Comment 6•4 years ago
|
||
Updated•4 years ago
|
| Assignee | ||
Comment 7•4 years ago
|
||
| Assignee | ||
Comment 8•4 years ago
|
||
| Assignee | ||
Comment 9•4 years ago
|
||
| Assignee | ||
Comment 10•4 years ago
|
||
| Assignee | ||
Comment 11•4 years ago
|
||
| Assignee | ||
Comment 12•4 years ago
|
||
| Assignee | ||
Comment 13•4 years ago
|
||
| Assignee | ||
Comment 14•4 years ago
|
||
| Assignee | ||
Comment 15•4 years ago
|
||
| Assignee | ||
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
Moving to General as Tetsuharu patches cover the whole DevTools codebase and Bug 1774507 was added to actually remove those
Updated•4 years ago
|
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/57c458e03d13
https://hg.mozilla.org/mozilla-central/rev/b55d74e32d80
https://hg.mozilla.org/mozilla-central/rev/0e9065aceda9
https://hg.mozilla.org/mozilla-central/rev/e4d4b5d97964
https://hg.mozilla.org/mozilla-central/rev/0696b251d05b
https://hg.mozilla.org/mozilla-central/rev/c60b6b4b8e05
https://hg.mozilla.org/mozilla-central/rev/2edcfb56a5b3
https://hg.mozilla.org/mozilla-central/rev/9e180a5e537e
https://hg.mozilla.org/mozilla-central/rev/d0d38a13dd1d
https://hg.mozilla.org/mozilla-central/rev/b33c102a1d59
https://hg.mozilla.org/mozilla-central/rev/569f2357ff4e
Description
•