Skip to content

Commit

Permalink
fix(ios): dead loops generated by nested text layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg authored and hippy-actions[bot] committed Dec 6, 2023
1 parent 49d8a58 commit 14da8fe
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,19 @@ - (void)amendLayoutBeforeMount:(NSMutableSet<NativeRenderApplierBlock> *)blocks
}
}
}];
[super amendLayoutBeforeMount:blocks];
}
@catch (NSException *exception) {
[super amendLayoutBeforeMount:blocks];

// Nested <Text> inside <Text> should not call amendLayoutBeforeMount again,
// so only call amendXxx when subcomponent is not a <Text>.
if (NativeRenderUpdateLifecycleComputed != _propagationLifecycle) {
_propagationLifecycle = NativeRenderUpdateLifecycleComputed;
for (HippyShadowView *shadowView in self.subcomponents) {
if (![shadowView isKindOfClass:NativeRenderObjectText.class]) {
[shadowView amendLayoutBeforeMount:blocks];
}
}
}
} @catch (NSException *exception) {
HippyLogError(@"Exception while doing %s: %@, %@", __func__, exception.description, self);
}
[self processUpdatedProperties:blocks parentProperties:nil];
}
Expand Down

0 comments on commit 14da8fe

Please sign in to comment.