0

React-Native is not showing images in IOS 14 or plus, it is not even showing images on simulator as well. The problem comes with the react-native version 62.2 and so on till 63.3 the release fixed it.

Sabaoon Bedar
  • 3,113
  • 2
  • 31
  • 37
  • Does this answer your question? [All Image/Fast Image in React Native app not working on iOS 14 beta and Xcode 12 beta](https://stackoverflow.com/questions/62612812/all-image-fast-image-in-react-native-app-not-working-on-ios-14-beta-and-xcode-12) – Thales Kenne Nov 11 '20 at 18:00

1 Answers1

0

The best way to remove this bug in react-native 62.2 is to follow the 5 steps:

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,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/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

1.- run "npm i -g patch-package"

2.- Make a new folder called patches

3.- Make a new file called react-native+0.63.0.patch inside that folder

4.- Add the source code above.

5.- run "patch-package" on the root of the project

Sabaoon Bedar
  • 3,113
  • 2
  • 31
  • 37