From c0abdbfaaead4b6fd999cb767cfa1de1cc046564 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Mon, 15 Mar 2021 13:57:29 +0100 Subject: [PATCH] [fix] setNativeProps logic setNativeProps method was ignoring previously changed style. Close #1939 Fix ##1935 --- .../react-native-web/src/modules/usePlatformMethods/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native-web/src/modules/usePlatformMethods/index.js b/packages/react-native-web/src/modules/usePlatformMethods/index.js index 4e91b677..9c3737d1 100644 --- a/packages/react-native-web/src/modules/usePlatformMethods/index.js +++ b/packages/react-native-web/src/modules/usePlatformMethods/index.js @@ -19,11 +19,12 @@ const emptyObject = {}; function setNativeProps(node, nativeProps, classList, pointerEvents, style, previousStyleRef) { if (node != null && nativeProps) { + const previousStyle = previousStyleRef ? previousStyleRef.current : {}; const domProps = createDOMProps(null, { pointerEvents, ...nativeProps, classList: [classList, nativeProps.className], - style: [style, nativeProps.style] + style: [style, previousStyle, nativeProps.style] }); const nextDomStyle = domProps.style;