Skip to content

Commit

Permalink
Recycle only views created by RN
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Apr 10, 2019
1 parent 66492e7 commit 4059034
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ private void dropView(View view) {

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. */
Expand Down

0 comments on commit 4059034

Please sign in to comment.