Skip to content

Warn about non-static getDerivedStateFromProps/Catch #12431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Mar 22, 2018

I found it pretty easy to do this mistake since it's the only static lifecycle.
So I figured let's warn about it.

screen shot 2018-03-22 at 5 40 22 pm

Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

Looks like a good warning to add.

Should we add a similar warning to the shallow renderer? Or is it okay to skip that one.

@gaearon
Copy link
Collaborator Author

gaearon commented Mar 22, 2018

Should we add a similar warning to the shallow renderer?

Meh. We don't do full validation there. I don't think it's very important.

@bvaughn
Copy link
Contributor

bvaughn commented Mar 22, 2018

Fair enough.

@gaearon gaearon merged commit 0af384b into facebook:master Mar 22, 2018
LeonYuAng3NT pushed a commit to LeonYuAng3NT/react that referenced this pull request Mar 22, 2018
rhagigi pushed a commit to rhagigi/react that referenced this pull request Apr 19, 2018
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.

3 participants