|
1 | 1 | #include "NativeReanimatedModule.h"
|
2 | 2 |
|
3 | 3 | #ifdef RCT_NEW_ARCH_ENABLED
|
| 4 | +#include <react/renderer/core/TraitCast.h> |
4 | 5 | #include <react/renderer/uimanager/UIManagerBinding.h>
|
5 | 6 | #include <react/renderer/uimanager/primitives.h>
|
6 | 7 | #endif
|
@@ -554,37 +555,40 @@ void NativeReanimatedModule::performOperations() {
|
554 | 555 | shadowTreeRegistry.visit(surfaceId_, [&](ShadowTree const &shadowTree) {
|
555 | 556 | auto lock = newestShadowNodesRegistry_->createLock();
|
556 | 557 |
|
557 |
| - shadowTree.commit([&](RootShadowNode const &oldRootShadowNode) { |
558 |
| - auto rootNode = oldRootShadowNode.ShadowNode::clone(ShadowNodeFragment{}); |
| 558 | + shadowTree.commit( |
| 559 | + [&](RootShadowNode const &oldRootShadowNode) { |
| 560 | + auto rootNode = |
| 561 | + oldRootShadowNode.ShadowNode::clone(ShadowNodeFragment{}); |
559 | 562 |
|
560 |
| - ShadowTreeCloner shadowTreeCloner{ |
561 |
| - newestShadowNodesRegistry_, uiManager_, surfaceId_}; |
| 563 | + ShadowTreeCloner shadowTreeCloner{ |
| 564 | + newestShadowNodesRegistry_, uiManager_, surfaceId_}; |
562 | 565 |
|
563 |
| - for (const auto &pair : copiedOperationsQueue) { |
564 |
| - const ShadowNodeFamily &family = pair.first->getFamily(); |
565 |
| - react_native_assert(family.getSurfaceId() == surfaceId_); |
| 566 | + for (const auto &pair : copiedOperationsQueue) { |
| 567 | + const ShadowNodeFamily &family = pair.first->getFamily(); |
| 568 | + react_native_assert(family.getSurfaceId() == surfaceId_); |
566 | 569 |
|
567 |
| - auto newRootNode = shadowTreeCloner.cloneWithNewProps( |
568 |
| - rootNode, family, RawProps(rt, *pair.second)); |
| 570 | + auto newRootNode = shadowTreeCloner.cloneWithNewProps( |
| 571 | + rootNode, family, RawProps(rt, *pair.second)); |
569 | 572 |
|
570 |
| - if (newRootNode == nullptr) { |
571 |
| - // this happens when React removed the component but Reanimated |
572 |
| - // still tries to animate it, let's skip update for this specific |
573 |
| - // component |
574 |
| - continue; |
575 |
| - } |
576 |
| - rootNode = newRootNode; |
577 |
| - } |
| 573 | + if (newRootNode == nullptr) { |
| 574 | + // this happens when React removed the component but Reanimated |
| 575 | + // still tries to animate it, let's skip update for this specific |
| 576 | + // component |
| 577 | + continue; |
| 578 | + } |
| 579 | + rootNode = newRootNode; |
| 580 | + } |
578 | 581 |
|
579 |
| - // remove ShadowNodes and its ancestors from NewestShadowNodesRegistry |
580 |
| - for (auto tag : copiedTagsToRemove) { |
581 |
| - newestShadowNodesRegistry_->remove(tag); |
582 |
| - } |
| 582 | + // remove ShadowNodes and its ancestors from NewestShadowNodesRegistry |
| 583 | + for (auto tag : copiedTagsToRemove) { |
| 584 | + newestShadowNodesRegistry_->remove(tag); |
| 585 | + } |
583 | 586 |
|
584 |
| - shadowTreeCloner.updateYogaChildren(); |
| 587 | + shadowTreeCloner.updateYogaChildren(); |
585 | 588 |
|
586 |
| - return std::static_pointer_cast<RootShadowNode>(rootNode); |
587 |
| - }); |
| 589 | + return std::static_pointer_cast<RootShadowNode>(rootNode); |
| 590 | + }, |
| 591 | + {/* default commit options */}); |
588 | 592 | });
|
589 | 593 | }
|
590 | 594 |
|
|
0 commit comments