mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-03 10:46:19 +00:00
[fix] setNativeProps
This commit is contained in:
@@ -77,11 +77,13 @@ const NativeMethodsMixin = {
|
|||||||
const style = {};
|
const style = {};
|
||||||
// DOM style is a CSSStyleDeclaration
|
// DOM style is a CSSStyleDeclaration
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration
|
// https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration
|
||||||
for (let i = node.style.length; i > 0; i -= 1) {
|
for (let i = 0; i < node.style.length; i += 1) {
|
||||||
const property = nodeStyle.item(i);
|
const property = nodeStyle.item(i);
|
||||||
// DOM style uses hyphenated prop names and may include vendor prefixes
|
if (property) {
|
||||||
// Transform back into React DOM style.
|
// DOM style uses hyphenated prop names and may include vendor prefixes
|
||||||
style[toCamelCase(property)] = nodeStyle.getPropertyValue(property);
|
// Transform back into React DOM style.
|
||||||
|
style[toCamelCase(property)] = nodeStyle.getPropertyValue(property);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const domStyleProps = { classList, style };
|
const domStyleProps = { classList, style };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user