Skip to content

Freeze ReactElement.props in dev mode #4172

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
Jun 19, 2015
Merged

Conversation

jimfb
Copy link
Contributor

@jimfb jimfb commented Jun 18, 2015

Freeze ReactElement.props in dev mode.

This diff removes the dev warning and freezes the props in dev. This means there is a minor divergence in runtime behavior of dev/prod, and breaks devtools (new devtools on the way), but we knew/acknowledged those points. As per @sebmarkbage, we are ok with these facts and still want to freeze.

Details: One might wonder why we freeze some things in the unit tests. This is because phantomjs has a quark where it treats frozen objects as different from non-frozen. Jest and Chrome don't care if things are frozen, but travis uses phantomjs, so, yeah.

@jimfb
Copy link
Contributor Author

jimfb commented Jun 18, 2015

cc @sebmarkbage @spicyj

jimfb added a commit that referenced this pull request Jun 19, 2015
Freeze ReactElement.props in dev mode
@jimfb jimfb merged commit ede27d2 into facebook:master Jun 19, 2015
sophiebits added a commit to sophiebits/react that referenced this pull request Jun 24, 2015
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