Skip to content

Commit

Permalink
Fix image block render in Xcode 12 (#25470)
Browse files Browse the repository at this point in the history
* Fix image block render in Xcode 12

This PR fixes #25431 which is a bug that prevents Image blocks from rendering their images. This only affects builds made using Xcode 12.
The bug itself is in React Native itself and was fixed in RN 0.63. Since we're on RN 0.61.5, we need to apply a patch (as suggested here facebook/react-native#29279 (comment)).

The patch was applied using the following steps found here: facebook/react-native#29279 (comment)

* Remove unnecessary changes to RN patch file
  • Loading branch information
guarani authored Sep 28, 2020
1 parent 3f2c0e3 commit ed848a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions patches/react-native+0.61.5.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ index 65fa2bb..c5f265b 100644
index++;
}

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 01aa75f..572572c 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -266,6 +266,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

- (void)displayLayer:(CALayer *)layer
{
+ if (!_currentFrame) {
+ _currentFrame = self.image;
+ }
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
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
Expand Down

0 comments on commit ed848a0

Please sign in to comment.