Skip to content

Commit

Permalink
fix(ios): fix view creation bug on release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg authored and hippy-actions[bot] committed Dec 22, 2023
1 parent e831f31 commit ee057dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion renderer/native/ios/renderer/HippyUIManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ - (void)removeAllObjects {
@end

static void NativeRenderTraverseViewNodes(id<HippyComponent> view, void (^block)(id<HippyComponent>)) {
if (view.hippyTag) {
if (view.hippyTag != nil) {
block(view);
for (id<HippyComponent> subview in view.subcomponents) {
NativeRenderTraverseViewNodes(subview, block);
Expand Down Expand Up @@ -789,6 +789,7 @@ - (void)createRenderNodes:(std::vector<std::shared_ptr<DomNode>> &&)nodes
}
[superRenderObject didUpdateHippySubviews];
}];
__block NSMutableArray *tempCreatedViews = [NSMutableArray arrayWithCapacity:nodes.size()]; // Used to temporarily hold views objects.
for (const std::shared_ptr<DomNode> &node : nodes) {
NSNumber *componentTag = @(node->GetId());
HippyShadowView *shadowView = [_shadowViewRegistry componentForTag:componentTag onRootTag:rootNodeTag];
Expand All @@ -804,6 +805,7 @@ - (void)createRenderNodes:(std::vector<std::shared_ptr<DomNode>> &&)nodes
[uiManager->_componentTransactionListeners addObject:view];
}
[uiManager.viewRegistry addComponent:view forRootTag:shadowView.rootTag];
[tempCreatedViews addObject:view];
// TODO: hippy3 events binding handling, performance needs to be improved here.
const std::vector<std::string> &eventNames = [shadowView allEventNames];
Expand Down

0 comments on commit ee057dc

Please sign in to comment.