forked from wordpress-mobile/WordPress-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RN patch for RCTShadowView.m to prevent crash in nested group blo…
…ck (wordpress-mobile#13310) * test patch * update podfile.lock
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/node_modules/react-native/React/Views/RCTShadowView.m b/node_modules/react-native/React/Views/RCTShadowView.m | ||
index 40c0cda..646f137 100644 | ||
--- a/node_modules/react-native/React/Views/RCTShadowView.m | ||
+++ b/node_modules/react-native/React/Views/RCTShadowView.m | ||
@@ -156,13 +156,11 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT], | ||
- (CGRect)measureLayoutRelativeToAncestor:(RCTShadowView *)ancestor | ||
{ | ||
CGPoint offset = CGPointZero; | ||
- NSInteger depth = 30; // max depth to search | ||
RCTShadowView *shadowView = self; | ||
- while (depth && shadowView && shadowView != ancestor) { | ||
+ while (shadowView && shadowView != ancestor) { | ||
offset.x += shadowView.layoutMetrics.frame.origin.x; | ||
offset.y += shadowView.layoutMetrics.frame.origin.y; | ||
shadowView = shadowView->_superview; | ||
- depth--; | ||
} | ||
if (ancestor != shadowView) { | ||
return CGRectNull; | ||
@@ -172,11 +170,9 @@ - (CGRect)measureLayoutRelativeToAncestor:(RCTShadowView *)ancestor | ||
|
||
- (BOOL)viewIsDescendantOf:(RCTShadowView *)ancestor | ||
{ | ||
- NSInteger depth = 30; // max depth to search | ||
RCTShadowView *shadowView = self; | ||
- while (depth && shadowView && shadowView != ancestor) { | ||
+ while (shadowView && shadowView != ancestor) { | ||
shadowView = shadowView->_superview; | ||
- depth--; | ||
} | ||
return ancestor == shadowView; | ||
} |