Skip to content

Commit

Permalink
Only freeze valid attributes in mountComponent
Browse files Browse the repository at this point in the history
Reviewed By: spicyj

Differential Revision: D2939910

fb-gh-sync-id: 2efe6ecd6d888d4185a8cc74ba9adbe7c68bcd3b
shipit-source-id: 2efe6ecd6d888d4185a8cc74ba9adbe7c68bcd3b
  • Loading branch information
matthewwithanm authored and facebook-github-bot-7 committed Feb 16, 2016
1 parent d1dbe2d commit ecf6981
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Libraries/ReactNative/ReactNativeBaseComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ ReactNativeBaseComponent.Mixin = {
var tag = ReactNativeTagHandles.allocateTag();

if (__DEV__) {
deepFreezeAndThrowOnMutationInDev(this._currentElement.props);
for (var key in this.viewConfig.validAttributes) {
if (this._currentElement.props.hasOwnProperty(key)) {
deepFreezeAndThrowOnMutationInDev(this._currentElement.props[key]);
}
}
}

var updatePayload = ReactNativeAttributePayload.create(
Expand Down

0 comments on commit ecf6981

Please sign in to comment.