Fabric: Do not crash in attempt to mount layout-only components
Summary: We do not have a clear strategy how to deal with layout-only (view-less) components. Even if this particular solution is not so fancy, it prevents crashing during text rendering. Reviewed By: mdvacca Differential Revision: D7785885 fbshipit-source-id: f3ed8988aa2b41349fd1693c2a7f8c9368daee43
This commit is contained in:
parent
f3893aab3b
commit
9ea7957958
|
@ -28,6 +28,11 @@
|
||||||
- (void)executeWithRegistry:(RCTComponentViewRegistry *)registry
|
- (void)executeWithRegistry:(RCTComponentViewRegistry *)registry
|
||||||
{
|
{
|
||||||
UIView<RCTComponentViewProtocol> *componentView = [registry componentViewByTag:_tag];
|
UIView<RCTComponentViewProtocol> *componentView = [registry componentViewByTag:_tag];
|
||||||
|
|
||||||
|
if (componentView == nil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[registry enqueueComponentViewWithName:_componentName tag:_tag componentView:componentView];
|
[registry enqueueComponentViewWithName:_componentName tag:_tag componentView:componentView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
UIView<RCTComponentViewProtocol> *childComponentView = [registry componentViewByTag:_childTag];
|
UIView<RCTComponentViewProtocol> *childComponentView = [registry componentViewByTag:_childTag];
|
||||||
UIView<RCTComponentViewProtocol> *parentComponentView = [registry componentViewByTag:_parentTag];
|
UIView<RCTComponentViewProtocol> *parentComponentView = [registry componentViewByTag:_parentTag];
|
||||||
|
|
||||||
|
if (childComponentView == nil || parentComponentView == nil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[parentComponentView mountChildComponentView:childComponentView
|
[parentComponentView mountChildComponentView:childComponentView
|
||||||
index:_index];
|
index:_index];
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
UIView<RCTComponentViewProtocol> *childComponentView = [registry componentViewByTag:_childTag];
|
UIView<RCTComponentViewProtocol> *childComponentView = [registry componentViewByTag:_childTag];
|
||||||
UIView<RCTComponentViewProtocol> *parentComponentView = [registry componentViewByTag:_parentTag];
|
UIView<RCTComponentViewProtocol> *parentComponentView = [registry componentViewByTag:_parentTag];
|
||||||
|
|
||||||
|
if (childComponentView == nil || parentComponentView == nil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[parentComponentView unmountChildComponentView:childComponentView
|
[parentComponentView unmountChildComponentView:childComponentView
|
||||||
index:_index];
|
index:_index];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue