Search code examples
imagereact-nativenavigator

React Native Android - Images rendering blank on navigating multiple pages


I have an app with multiple scenes. To render most of them, I don't need a stack maintained, hence am using navigator.replace(HomeScene).

Now, from 1 particular scene, say Scene 1, I push Scene 2, Then from Scene 2 I push Scene 3. Now I am 2 levels deep in the navigator. From here, if I go back to HomeScene using navigator.immediatelyResetRouteStack([HomeScene]), some of the images from HomeScene do not render. Here onwards, on every scene, images randomly are visible or invisible. No fixed pattern.

This happens majorly when I am deep into the stack, and rarely when there is only 1 level pushed to the stack.

Not sure if this is related to the Navigator or something else. Any suggestions?


Solution

  • I think I have found the solution to this. It doesn't seem to be related to the Navigator. Basically, if there are many images on one single page, some images may not render due to large memory used. Adding android:largeHeap="true" under the <application > tag in the AndroidManifest.xml file does the trick!