Sfoglia il codice sorgente

[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.
j8
Saúl Ibarra Corretgé 8 anni fa
parent
commit
03b043ca2b

+ 7
- 0
react/features/base/react/components/native/Container.js Vedi 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…
Annulla
Salva