From ecf6981093f7f9afe4a462eee9e7af864c6d9e70 Mon Sep 17 00:00:00 2001 From: Matthew Dapena-Tretter Date: Tue, 16 Feb 2016 13:57:30 -0800 Subject: [PATCH] Only freeze valid attributes in `mountComponent` Reviewed By: spicyj Differential Revision: D2939910 fb-gh-sync-id: 2efe6ecd6d888d4185a8cc74ba9adbe7c68bcd3b shipit-source-id: 2efe6ecd6d888d4185a8cc74ba9adbe7c68bcd3b --- Libraries/ReactNative/ReactNativeBaseComponent.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/ReactNative/ReactNativeBaseComponent.js b/Libraries/ReactNative/ReactNativeBaseComponent.js index ceb600aaaa..19afca8036 100644 --- a/Libraries/ReactNative/ReactNativeBaseComponent.js +++ b/Libraries/ReactNative/ReactNativeBaseComponent.js @@ -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(