mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 09:37:21 +08:00
Disallow mounting virtual nodes to Views
Summary: Virtual shadow nodes, such as RCTRawText, RCTTextInlineImage etc cannot be mounted to a View (ViewManager will throw an Exception if we ever try to). This diff is adding a check to make sure that Exception is never thrown. Reviewed By: ahmedre Differential Revision: D2800869
This commit is contained in:
committed by
Ahmed El-Helw
parent
05544f6bca
commit
b10474c333
@@ -254,6 +254,10 @@ import com.facebook.react.uimanager.ViewProps;
|
||||
}
|
||||
|
||||
/* package */ final void forceMountToView() {
|
||||
if (isVirtual()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDrawView == null) {
|
||||
mDrawView = DrawView.INSTANCE;
|
||||
if (getParent() != null) {
|
||||
|
||||
Reference in New Issue
Block a user