From d36b493e99a81510b62a95a510e779ef2a167521 Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Wed, 16 Oct 2024 04:44:19 -0700 Subject: [PATCH] Make unmount only happens when IM is enabled Summary: We should respect the IM config. Reviewed By: adityasharat Differential Revision: D64395328 fbshipit-source-id: fb112325010cad0bedfc8f8f5058af404f49a2f1 --- .../src/main/java/com/facebook/litho/BaseMountingView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litho-core/src/main/java/com/facebook/litho/BaseMountingView.java b/litho-core/src/main/java/com/facebook/litho/BaseMountingView.java index 7faa03d138..face789b2a 100644 --- a/litho-core/src/main/java/com/facebook/litho/BaseMountingView.java +++ b/litho-core/src/main/java/com/facebook/litho/BaseMountingView.java @@ -333,7 +333,11 @@ protected void onDetached() { private void maybeUnmountComponents() { final @Nullable ComponentsConfiguration config = getConfiguration(); - if (config != null && config.enableFixForIM && !mIsTemporaryDetached && !hasTransientState()) { + if (config != null + && config.enableFixForIM + && !mIsTemporaryDetached + && !hasTransientState() + && isIncrementalMountEnabled()) { notifyVisibleBoundsChanged(EMPTY_RECT); } }