-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
props in constructor does not match props in render #5772
Comments
Actually he’s not mutating it. He is creating a new I’m with you in the fact that you shouldn’t do it, but there’s no apparent reason it shouldn’t work. |
See #5320 for another discussion about this (from a slightly different angle) - namely @sebmarkbage's first comment about initialization vs updates. Note: that PR was merged but was backed out because of the discussion. If you'd like to use default values for props ( |
@zpao I guess I'm still a little unclear.. are you saying |
@dbkaplun Correct - The If you were using a more modern release of React, you should get a warning when you passed in the modified props: #5335 |
Expected:
Actual:
Code: http://jsbin.com/gutagazaxa/1/edit?html,js,output
The text was updated successfully, but these errors were encountered: