Search code examples
androidreact-nativestylesz-index

React native zIndex causes unstable rendering in screen in android


have anyone face unstable rendering components in a screen caused by zIndex? i have a screen with multiple components and two components using zIndex is loading and list suggestion. Everytime a put zIndex into those components' container, it causes unstable rendering for components in screen such as: one of components disappear, text images of component disappear just white background, sometime it freeze the screen. I tried some solutions but not solved so I need some advice about this.

My environment

react: ^16.0.0-alpha.6

react-native": ^0.43.4

Genymotion: 2.9.0

Virtual Device: Google Nexus 5X 1080x1920

I posted my code in gist https://gist.github.com/nhuthuynh/009dee73675c1dbed41d34a86b359057

enter image description here enter image description here


Solution

  • Use elevation in android version of react-native.