From 95c414cfbf6f9ae0eeda5199e64afec7c4b29d82 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Sun, 3 Mar 2019 08:55:25 -0800 Subject: [PATCH] Introduce "updateProps" field InsertMutation Summary: This diff introduces the concept of "updateProps" as part of InsertMutation and it changes the diffing algorithm to populate this field. Reviewed By: shergin Differential Revision: D14289608 fbshipit-source-id: 642f00d03d294a12ea7fa7482c72e701b756f3d4 --- .../main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp | 6 ++++-- ReactCommon/fabric/mounting/Differentiator.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp index 70e5e9fd9fd..b0775e10721 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp @@ -402,8 +402,10 @@ void Binding::schedulerDidFinishTransaction( mountItems[position++] = createInsertMountItem(javaUIManager_, mutation); - mountItems[position++] = - createUpdatePropsMountItem(javaUIManager_, mutation); + if (mutation.newChildShadowView.props->revision != 0) { + mountItems[position++] = + createUpdatePropsMountItem(javaUIManager_, mutation); + } auto updateLayoutMountItem = createUpdateLayoutMountItem(javaUIManager_, mutation); diff --git a/ReactCommon/fabric/mounting/Differentiator.cpp b/ReactCommon/fabric/mounting/Differentiator.cpp index f0f5622567d..2f8a932c6bf 100644 --- a/ReactCommon/fabric/mounting/Differentiator.cpp +++ b/ReactCommon/fabric/mounting/Differentiator.cpp @@ -116,7 +116,7 @@ static void calculateShadowViewMutations( const auto &newChildPair = newChildPairs[index]; insertMutations.push_back(ShadowViewMutation::InsertMutation( - parentShadowView, newChildPair.shadowView, index)); + parentShadowView, newChildPair.shadowView, index)); insertedPairs.insert({newChildPair.shadowView.tag, newChildPair}); }