Remove hard crash when root view is reused

Summary: Alternative to D10499861. If an app does not have an exception handler, context.handleException will still hard crash. Since this error is just saying that we're reusing an unexpected RootView, it might be safe to continue execution. Let's remove the exception for now while we investigate further

Reviewed By: mmmulani

Differential Revision: D10560413

fbshipit-source-id: 6c08a16cd250a019d2aef5afcaf3ba61534d29f7
This commit is contained in:
Andrew Chen (Eng)
2018-10-24 13:06:48 -07:00
committed by Facebook Github Bot
parent b141363943
commit dc74975c5f

View File

@@ -543,12 +543,12 @@ public class NativeViewHierarchyManager {
ViewGroup view,
ThemedReactContext themedContext) {
if (view.getId() != View.NO_ID) {
themedContext.handleException(
new IllegalViewOperationException(
"Trying to add a root view with an explicit id (" + view.getId() + ") already " +
"set. React Native uses the id field to track react tags and will overwrite this field. " +
"If that is fine, explicitly overwrite the id field to View.NO_ID before calling " +
"addRootView."));
FLog.e(
TAG,
"Trying to add a root view with an explicit id (" + view.getId() + ") already " +
"set. React Native uses the id field to track react tags and will overwrite this field. " +
"If that is fine, explicitly overwrite the id field to View.NO_ID before calling " +
"addRootView.");
}
mTagsToViews.put(tag, view);