Recycle only views created by RN

Summary: This diff ensure that only views created by RN are taken into consideration for recycling.

Reviewed By: fkgozali

Differential Revision: D14874678

fbshipit-source-id: ea7dd5a0f29f6acf0dce8573fc77b012395476bd
This commit is contained in:
David Vacca
2019-04-10 14:06:24 -07:00
committed by Facebook Github Bot
parent 66492e7f9b
commit 40590348ea

View File

@@ -94,8 +94,11 @@ public class MountingManager {
mTagToViewState.remove(reactTag);
Context context = view.getContext();
mViewFactory.recycle(
(ThemedReactContext) context, Assertions.assertNotNull(viewManager).getName(), view);
if (context instanceof ThemedReactContext) {
// We only recycle views that were created by RN (its context is instance of ThemedReactContext)
mViewFactory.recycle(
(ThemedReactContext) context, Assertions.assertNotNull(viewManager).getName(), view);
}
}
/** Releases all references to react root tag. */