diff --git a/src/core/ReactNativeComponent.js b/src/core/ReactNativeComponent.js index 588f414fa2..db36aea3d6 100644 --- a/src/core/ReactNativeComponent.js +++ b/src/core/ReactNativeComponent.js @@ -253,14 +253,12 @@ ReactNativeComponent.Mixin = { if (nextProp) { nextProp = nextProps.style = merge(nextProp); } - if (lastProp) { - for (styleName in lastProp) { - if (lastProp.hasOwnProperty(styleName) && !nextProp[styleName]) { - if (!styleUpdates) { - styleUpdates = {}; - } - styleUpdates[styleName] = ''; + for (styleName in lastProp) { + if (lastProp.hasOwnProperty(styleName) && !nextProp[styleName]) { + if (!styleUpdates) { + styleUpdates = {}; } + styleUpdates[styleName] = ''; } } for (styleName in nextProp) { diff --git a/src/dom/DOMProperty.js b/src/dom/DOMProperty.js index a08f628ef3..4b9d44534f 100644 --- a/src/dom/DOMProperty.js +++ b/src/dom/DOMProperty.js @@ -107,9 +107,8 @@ var DOMProperty = { * attribute). Most default values are '' or false, but not all. Worse yet, * some (in particular, `type`) vary depending on the type of element. * - * TODO: Is it worth caching the test elements? Caching the properties - * ourselves (as opposed to accessing from a cached test element every time) - * looks probably worth it: http://jsperf.com/object-vs-element + * TODO: Is it better to grab all the possible properties when creating an + * element to avoid having to create the same element twice? */ getDefaultValueForProperty: function(nodeName, prop) { var nodeDefaults = defaultValueCache[nodeName];