react-native-unistyles 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,14 +20,16 @@ void shadow::ShadowTreeManager::updateShadowTree(jsi::Runtime& rt) {
|
|
|
20
20
|
std::unordered_map<Tag, folly::dynamic> tagToProps;
|
|
21
21
|
|
|
22
22
|
for (const auto& [family, props] : updates) {
|
|
23
|
-
|
|
23
|
+
auto safeProps = props.isObject() ? props : folly::dynamic::object();
|
|
24
|
+
|
|
25
|
+
tagToProps.insert({family->getTag(), safeProps});
|
|
24
26
|
|
|
25
27
|
auto* mutableFamily = const_cast<ShadowNodeFamily*>(family);
|
|
26
28
|
|
|
27
|
-
if (mutableFamily->nativeProps_DEPRECATED) {
|
|
28
|
-
mutableFamily->nativeProps_DEPRECATED->update(
|
|
29
|
+
if (mutableFamily->nativeProps_DEPRECATED && mutableFamily->nativeProps_DEPRECATED->isObject()) {
|
|
30
|
+
mutableFamily->nativeProps_DEPRECATED->update(safeProps);
|
|
29
31
|
} else {
|
|
30
|
-
mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(
|
|
32
|
+
mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(safeProps);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -45,11 +47,12 @@ void shadow::ShadowTreeManager::updateShadowTree(jsi::Runtime& rt) {
|
|
|
45
47
|
for (const auto& [family, props] : updates) {
|
|
46
48
|
// Merge props to fix glitches caused by REA updates
|
|
47
49
|
auto* mutableFamily = const_cast<ShadowNodeFamily*>(family);
|
|
50
|
+
auto safeProps = props.isObject() ? props : folly::dynamic::object();
|
|
48
51
|
|
|
49
|
-
if (mutableFamily->nativeProps_DEPRECATED) {
|
|
50
|
-
mutableFamily->nativeProps_DEPRECATED->update(
|
|
52
|
+
if (mutableFamily->nativeProps_DEPRECATED && mutableFamily->nativeProps_DEPRECATED->isObject()) {
|
|
53
|
+
mutableFamily->nativeProps_DEPRECATED->update(safeProps);
|
|
51
54
|
} else {
|
|
52
|
-
mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(
|
|
55
|
+
mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(safeProps);
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
|