mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
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:
committed by
Facebook Github Bot
parent
b141363943
commit
dc74975c5f
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user