diff --git a/packages/react-native-web/src/components/View/index.js b/packages/react-native-web/src/components/View/index.js index decc0ebe..657b0d0b 100644 --- a/packages/react-native-web/src/components/View/index.js +++ b/packages/react-native-web/src/components/View/index.js @@ -65,7 +65,7 @@ class View extends Component { if (hitSlop) { const hitSlopStyle = calculateHitSlopStyle(hitSlop); const hitSlopChild = createElement('span', { style: [styles.hitSlop, hitSlopStyle] }); - otherProps.children = React.Children.toArray([ hitSlopChild, otherProps.children ]); + otherProps.children = React.Children.toArray([hitSlopChild, otherProps.children]); } return createElement('div', otherProps); diff --git a/packages/react-native-web/src/modules/NativeMethodsMixin/index.js b/packages/react-native-web/src/modules/NativeMethodsMixin/index.js index 243b21d9..6b500e56 100644 --- a/packages/react-native-web/src/modules/NativeMethodsMixin/index.js +++ b/packages/react-native-web/src/modules/NativeMethodsMixin/index.js @@ -102,6 +102,10 @@ const NativeMethodsMixin = { * the initial styles from the DOM node and merge them with incoming props. */ setNativeProps(nativeProps: Object) { + if (!nativeProps) { + return; + } + // Copy of existing DOM state const node = findNodeHandle(this); const nodeStyle = node.style; @@ -117,10 +121,14 @@ const NativeMethodsMixin = { style[toCamelCase(property)] = nodeStyle.getPropertyValue(property); } } - const domStyleProps = { classList, style }; + const domStyleProps = { classList, style }; + const props = { + ...nativeProps, + style: i18nStyle(nativeProps.style) + }; // Next DOM state - const domProps = createDOMProps(null, i18nStyle(nativeProps), style => + const domProps = createDOMProps(null, props, style => StyleRegistry.resolveStateful(style, domStyleProps, { i18n: false }) ); UIManager.updateView(node, domProps, this);