Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RN patch for RCTShadowView.m to prevent crash in nested group block #13310

Merged
merged 2 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ target 'WordPress' do


post_install do
puts 'Patching RCTShadowView to fix nested group block - it could be removed after upgrade to 0.62'
%x(patch Pods/React-Core/React/Views/RCTShadowView.m < patches/react-native+0.61.5.patch)


## Convert the 3rd-party license acknowledgements markdown into html for use in the app
require 'commonmarker'
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,6 @@ SPEC CHECKSUMS:
ZendeskSDK: 99679d8420a6d862773e2ddef0ebcc51b282317d
ZIPFoundation: 89df685c971926b0323087952320bdfee9f0b6ef

PODFILE CHECKSUM: 157e2314e6458ae8d3b542db61fe84aa898b7a1a
PODFILE CHECKSUM: 2013bfbcd92e0ee78c4034af02ed2039eac15058

COCOAPODS: 1.8.4
32 changes: 32 additions & 0 deletions patches/react-native+0.61.5.patch
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;
}