From 47fad1ef583e3ab76eeb057718da50c6bda1a117 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Sat, 29 Apr 2017 18:48:52 -0700 Subject: [PATCH] [fix] setNativeProps --- src/modules/NativeMethodsMixin/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/NativeMethodsMixin/index.js b/src/modules/NativeMethodsMixin/index.js index d0cedd86..fe04586a 100644 --- a/src/modules/NativeMethodsMixin/index.js +++ b/src/modules/NativeMethodsMixin/index.js @@ -77,11 +77,13 @@ const NativeMethodsMixin = { const style = {}; // DOM style is a CSSStyleDeclaration // https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration - for (let i = node.style.length; i > 0; i -= 1) { + for (let i = 0; i < node.style.length; i += 1) { const property = nodeStyle.item(i); - // DOM style uses hyphenated prop names and may include vendor prefixes - // Transform back into React DOM style. - style[toCamelCase(property)] = nodeStyle.getPropertyValue(property); + if (property) { + // DOM style uses hyphenated prop names and may include vendor prefixes + // Transform back into React DOM style. + style[toCamelCase(property)] = nodeStyle.getPropertyValue(property); + } } const domStyleProps = { classList, style };