mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-22 14:21:44 +00:00
[fix] setNativeProps logic
setNativeProps method was ignoring previously changed style. Close #1939 Fix ##1935
This commit is contained in:
committed by
Nicolas Gallagher
parent
889827e3a4
commit
c0abdbfaae
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user