FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Enabled warnAboutDeprecatedLifecycles flag by default by bvaughn · Pull Request #15186 · react/react · GitHub

Repository navigation

Enabled warnAboutDeprecatedLifecycles flag by default - #15186

Merged
bvaughn merged 1 commit into
react:masterfrom
bvaughn:warnAboutDeprecatedLifecycles
Mar 27, 2019
Merged

bvaughn merged 1 commit into
react:masterfrom
bvaughn:warnAboutDeprecatedLifecycles

Conversation

bvaughn commented Mar 21, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor

Also updated tests to account for this. (Mostly this involved merging some "internal" tests that are no longer internal.)

Note that we still only warn about "unsafe" lifecycle methods in strict mode, but now we will always warn about the "legacy" lifecycles.

bvaughn force-pushed the warnAboutDeprecatedLifecycles branch from 862b335 to 8742dce Compare March 21, 2019 22:44
bvaughn requested a review from sebmarkbage March 27, 2019 23:22

bvaughn commented Mar 27, 2019

Copy link
Copy Markdown
Contributor Author

Ping!

sebmarkbage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

looksgooddidnotread

bvaughn commented Mar 27, 2019

Copy link
Copy Markdown
Contributor Author

rightbackatyabuddy

bvaughn merged commit d8cb10f into react:master Mar 27, 2019
bvaughn deleted the warnAboutDeprecatedLifecycles branch March 27, 2019 23:30
).toLowPriorityWarnDev(
[
'componentWillMount is deprecated and will be removed in the next major version. ' +
'Use componentDidMount instead. As a temporary workaround, ' +

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

"As a temporary workaround" — people will 100% read it as "UNSAFE_ version will be removed in 17". We've already seen this confusion despite explicit assurances it won't be. We need to emphasize this in the message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The workaround is still temporary, in that using the (renamed) method is still unsafe.

If you have proposals for an alternate error message, post a PR, but I don't think we should make it sound like ongoing use of the unsafe lifecycles is totally fine either.

sebmarkbage Mar 28, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm not sure it's better to error on the side of less scary.

It is really unsafe even with "batched" Suspense too, and just generally a risk factor in server rendering. Not just concurrent mode. So you'll likely be left behind one way or another.

So even though we probably won't completely remove it, it's probably a good idea to treat it almost as bad as if we would.

Does it matter if you can upgrade to React 18 but not use any of the new features in it?

gaearon mentioned this pull request Jul 30, 2019
This was referenced Mar 10, 2020
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL