diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp b/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp index c9f5b13ab0c..d6b46c68a01 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +++ b/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp @@ -203,10 +203,15 @@ void LayoutAnimationDriver::animationMutationsForFrame( // Copy so that if something else mutates the inflight animations, it // won't change this mutation after this point. + ShadowView oldShadowView{}; + if (finalMutationForKeyFrame.type != + ShadowViewMutation::Type::Update) { + oldShadowView = finalMutationForKeyFrame.oldChildShadowView; + } mutationsList.push_back( ShadowViewMutation{finalMutationForKeyFrame.type, finalMutationForKeyFrame.parentShadowView, - finalMutationForKeyFrame.oldChildShadowView, + oldShadowView, finalMutationForKeyFrame.newChildShadowView, finalMutationForKeyFrame.index}); } else { @@ -217,7 +222,7 @@ void LayoutAnimationDriver::animationMutationsForFrame( mutationsList.push_back( ShadowViewMutation{ShadowViewMutation::Type::Update, keyframe.parentView, - keyframe.viewStart, + {}, keyframe.viewEnd, -1}); } diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp index 08fbe459d7a..4264be5d3c6 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +++ b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp @@ -1212,7 +1212,16 @@ LayoutAnimationKeyFrameManager::pullTransaction( auto &keyFrame = std::get<0>(conflictingKeyframeTuple); if (keyFrame.finalMutationForKeyFrame.hasValue()) { auto &mutation = *keyFrame.finalMutationForKeyFrame; - finalConflictingMutations.push_back(mutation); + if (mutation.type == ShadowViewMutation::Type::Update) { + finalConflictingMutations.push_back( + ShadowViewMutation::UpdateMutation( + mutation.parentShadowView, + {}, + mutation.newChildShadowView, + mutation.index)); + } else { + finalConflictingMutations.push_back(mutation); + } } }