@@ -22,9 +22,13 @@ void shadow::ShadowTreeManager::updateShadowTree(jsi::Runtime& rt) {
2222 for (const auto & [family, props] : updates) {
2323 tagToProps.insert ({family->getTag (), props});
2424
25- // Store in native props system to preserve during Reanimated cloning
26- const_cast <ShadowNodeFamily*>(family)->nativeProps_DEPRECATED =
27- std::make_unique<folly::dynamic>(props);
25+ auto * mutableFamily = const_cast <ShadowNodeFamily*>(family);
26+
27+ if (mutableFamily->nativeProps_DEPRECATED ) {
28+ mutableFamily->nativeProps_DEPRECATED ->update (props);
29+ } else {
30+ mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(props);
31+ }
2832 }
2933
3034 UIManagerBinding::getBinding (rt)->getUIManager ().updateShadowTree (std::move (tagToProps));
@@ -40,8 +44,13 @@ void shadow::ShadowTreeManager::updateShadowTree(jsi::Runtime& rt) {
4044
4145 for (const auto & [family, props] : updates) {
4246 // Merge props to fix glitches caused by REA updates
43- const_cast <ShadowNodeFamily*>(family)->nativeProps_DEPRECATED =
44- std::make_unique<folly::dynamic>(props);
47+ auto * mutableFamily = const_cast <ShadowNodeFamily*>(family);
48+
49+ if (mutableFamily->nativeProps_DEPRECATED ) {
50+ mutableFamily->nativeProps_DEPRECATED ->update (props);
51+ } else {
52+ mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(props);
53+ }
4554 }
4655
4756 return std::static_pointer_cast<RootShadowNode>(shadow::ShadowTreeManager::cloneShadowTree (
0 commit comments