Skip to content

Commit

Permalink
Remove hard crash when root view is reused
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ayc1 authored and facebook-github-bot committed Oct 24, 2018
1 parent b141363 commit dc74975
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,12 @@ protected synchronized final void addRootViewGroup(
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);
Expand Down

0 comments on commit dc74975

Please sign in to comment.