NativeAnimatedModule: don't restore default values when disconnected nodes in Fabric

Summary:
See title.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22488069

fbshipit-source-id: a0cb2dc65e5ea4befd7921acd194a67840b1498d
This commit is contained in:
Joshua Gross
2020-07-10 23:32:37 -07:00
committed by Facebook GitHub Bot
parent 80f13412e5
commit 7bf56e1902
2 changed files with 22 additions and 3 deletions
@@ -13,6 +13,8 @@ import com.facebook.react.bridge.JavaOnlyMap;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.uimanager.common.UIManagerType;
import com.facebook.react.uimanager.common.ViewUtil;
import java.util.HashMap;
import java.util.Map;
@@ -69,6 +71,14 @@ import java.util.Map;
if (mConnectedViewTag == -1) {
return;
}
// Don't restore default values in Fabric.
// In Non-Fabric this had the effect of "restore the value to whatever the value was on the
// ShadowNode instead of in the View hierarchy". However, "synchronouslyUpdateViewOnUIThread"
// will not have that impact on Fabric, because the FabricUIManager doesn't have access to the
// ShadowNode layer.
if (ViewUtil.getUIManagerType(mConnectedViewTag) == UIManagerType.FABRIC) {
return;
}
ReadableMapKeySetIterator it = mPropMap.keySetIterator();
while (it.hasNextKey()) {