소스 검색

[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
     View
7
     View
8
 } from 'react-native';
8
 } from 'react-native';
9
 
9
 
10
+import { Platform } from '../../';
10
 import AbstractContainer from '../AbstractContainer';
11
 import AbstractContainer from '../AbstractContainer';
11
 
12
 
12
 /**
13
 /**
38
 
39
 
39
         // visible
40
         // visible
40
         if (!visible) {
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
             // Intentionally hide this Container without destroying it.
48
             // Intentionally hide this Container without destroying it.
42
             // TODO Replace with display: 'none' supported in RN >= 0.43.
49
             // TODO Replace with display: 'none' supported in RN >= 0.43.
43
             props.style = {
50
             props.style = {

Loading…
취소
저장