mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 10:07:35 +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) {
|
function setNativeProps(node, nativeProps, classList, pointerEvents, style, previousStyleRef) {
|
||||||
if (node != null && nativeProps) {
|
if (node != null && nativeProps) {
|
||||||
|
const previousStyle = previousStyleRef ? previousStyleRef.current : {};
|
||||||
const domProps = createDOMProps(null, {
|
const domProps = createDOMProps(null, {
|
||||||
pointerEvents,
|
pointerEvents,
|
||||||
...nativeProps,
|
...nativeProps,
|
||||||
classList: [classList, nativeProps.className],
|
classList: [classList, nativeProps.className],
|
||||||
style: [style, nativeProps.style]
|
style: [style, previousStyle, nativeProps.style]
|
||||||
});
|
});
|
||||||
|
|
||||||
const nextDomStyle = domProps.style;
|
const nextDomStyle = domProps.style;
|
||||||
|
|||||||
Reference in New Issue
Block a user