Skip to content
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

Don't warn about class components using getInitialState if state is set #8594

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Dec 17, 2016

We warn about getInitialState() usage in class components in case users accidentally used it when they should have used .state. If they have also specified .state though then it seems unnecessary to blacklist this property name.

Context: https://twitter.com/soprano/status/810003963286163456

… also set

We warn about getInitialState() usage in class components because users may have accidentally used it instead of state. If they have also specified state though then we should skip this warning.

Context: https://twitter.com/soprano/status/810003963286163456
@bvaughn bvaughn merged commit 3c6d4ba into facebook:master Dec 17, 2016
@bvaughn bvaughn deleted the dont-warn-about-getInitialState-on-class-if-state-set branch December 17, 2016 22:28
@gaearon
Copy link
Collaborator

gaearon commented Dec 17, 2016

@bvaughn Please attach 15-next milestone and a semver label when merging. The tool doesn't pick up other PRs so we could miss it in the next release otherwise.

@gaearon gaearon added this to the 15-next milestone Dec 17, 2016
@bvaughn
Copy link
Contributor Author

bvaughn commented Dec 18, 2016

Thanks @gaearon! I hadn't known about the labels.

@gaearon gaearon modified the milestones: 15-hipri, 15-lopri, 15.4.2 Jan 6, 2017
gaearon pushed a commit that referenced this pull request Jan 6, 2017
…-on-class-if-state-set

Don't warn about class components using getInitialState if state is set
(cherry picked from commit 3c6d4ba)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants