浏览代码

[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 年前
父节点
当前提交
03b043ca2b
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7
    0
      react/features/base/react/components/native/Container.js

+ 7
- 0
react/features/base/react/components/native/Container.js 查看文件

@@ -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 = {

正在加载...
取消
保存