File tree 2 files changed +11
-3
lines changed
packages/react-native-web/src
modules/NativeMethodsMixin 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class View extends Component<ViewProps> {
65
65
if ( hitSlop ) {
66
66
const hitSlopStyle = calculateHitSlopStyle ( hitSlop ) ;
67
67
const hitSlopChild = createElement ( 'span' , { style : [ styles . hitSlop , hitSlopStyle ] } ) ;
68
- otherProps . children = React . Children . toArray ( [ hitSlopChild , otherProps . children ] ) ;
68
+ otherProps . children = React . Children . toArray ( [ hitSlopChild , otherProps . children ] ) ;
69
69
}
70
70
71
71
return createElement ( 'div ', otherProps ) ;
Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ const NativeMethodsMixin = {
102
102
* the initial styles from the DOM node and merge them with incoming props.
103
103
*/
104
104
setNativeProps ( nativeProps : Object ) {
105
+ if ( ! nativeProps ) {
106
+ return ;
107
+ }
108
+
105
109
// Copy of existing DOM state
106
110
const node = findNodeHandle ( this ) ;
107
111
const nodeStyle = node . style ;
@@ -117,10 +121,14 @@ const NativeMethodsMixin = {
117
121
style [ toCamelCase ( property ) ] = nodeStyle . getPropertyValue ( property ) ;
118
122
}
119
123
}
120
- const domStyleProps = { classList, style } ;
121
124
125
+ const domStyleProps = { classList, style } ;
126
+ const props = {
127
+ ...nativeProps ,
128
+ style : i18nStyle ( nativeProps . style )
129
+ } ;
122
130
// Next DOM state
123
- const domProps = createDOMProps ( null , i18nStyle ( nativeProps ) , style =>
131
+ const domProps = createDOMProps ( null , props , style =>
124
132
StyleRegistry . resolveStateful ( style , domStyleProps , { i18n : false } )
125
133
) ;
126
134
UIManager . updateView ( node , domProps , this ) ;
You can’t perform that action at this time.
0 commit comments