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

Make warning about state assignment better in ReactFiberClassComponent #11830

Closed

Conversation

yenshih
Copy link
Contributor

@yenshih yenshih commented Dec 11, 2017

Hi, I have extracted some common code about warning in ReactFiberClassComponent.
It seems the warning about state assignment in componentWillMount and componentWillReceiveProps can use a same function, which avoid hard coding the warning log twice.

@gaearon
Copy link
Collaborator

gaearon commented Dec 11, 2017

Thanks for the PR! I don't think we'll take this, as we generally don't mind some light duplication, and in this case extracting doesn't make it much clearer.

However I just noticed the first warning doesn't seem to be deduplicated. Could you send a PR that fixes that instead?

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.

None yet

3 participants