From 03b043ca2bd4a2af9759b91f1287bff670336a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 28 Jul 2017 15:09:13 +0200 Subject: [PATCH] [Android] Destroy containes when they are not visible Whatever I've tried so far ends up failing in really weird ways, so let's admit defeat, for now. Destroy containers only on Android. This shall be revisited when we update RN to version >= 0.43 and we have "display: 'none'" available. --- react/features/base/react/components/native/Container.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/react/features/base/react/components/native/Container.js b/react/features/base/react/components/native/Container.js index 4b79bf41b..1de76511e 100644 --- a/react/features/base/react/components/native/Container.js +++ b/react/features/base/react/components/native/Container.js @@ -7,6 +7,7 @@ import { View } from 'react-native'; +import { Platform } from '../../'; import AbstractContainer from '../AbstractContainer'; /** @@ -38,6 +39,12 @@ export default class Container extends AbstractContainer { // visible if (!visible) { + // FIXME: Whatever I try ends up failing somehow on Android, give up + // for now, hoping display: 'none' solves this. + if (Platform.OS === 'android') { + return null; + } + // Intentionally hide this Container without destroying it. // TODO Replace with display: 'none' supported in RN >= 0.43. props.style = {