Browse Source

[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.
master
Saúl Ibarra Corretgé 8 years ago
parent
commit
03b043ca2b
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      react/features/base/react/components/native/Container.js

+ 7
- 0
react/features/base/react/components/native/Container.js View File

@@ -7,6 +7,7 @@ import {
7 7
     View
8 8
 } from 'react-native';
9 9
 
10
+import { Platform } from '../../';
10 11
 import AbstractContainer from '../AbstractContainer';
11 12
 
12 13
 /**
@@ -38,6 +39,12 @@ export default class Container extends AbstractContainer {
38 39
 
39 40
         // visible
40 41
         if (!visible) {
42
+            // FIXME: Whatever I try ends up failing somehow on Android, give up
43
+            // for now, hoping display: 'none' solves this.
44
+            if (Platform.OS === 'android') {
45
+                return null;
46
+            }
47
+
41 48
             // Intentionally hide this Container without destroying it.
42 49
             // TODO Replace with display: 'none' supported in RN >= 0.43.
43 50
             props.style = {

Loading…
Cancel
Save