Skip to content

Commit abbf0eb

Browse files
committed
fix(ios): remove subview in _subviews
1 parent afccdea commit abbf0eb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

packages/react-native-external-display/ios/RNExternalDisplayView.mm

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import "RNExternalDisplayView.h"
2-
#import "UIView+React.h"
3-
#import "RCTShadowView.h"
2+
#import <React/UIView+React.h>
3+
#import <React/RCTShadowView.h>
44
#import <React/RCTLog.h>
55
#ifdef RCT_NEW_ARCH_ENABLED
66
#import <React/RCTFabricComponentsPlugins.h>
@@ -10,7 +10,7 @@
1010
#define RCTTouchHandler RCTSurfaceTouchHandler
1111
#else
1212
#import <React/RCTBridge+Private.h>
13-
#import "RCTTouchHandler.h"
13+
#import <React/RCTTouchHandler.h>
1414
#endif
1515

1616
@implementation RNExternalDisplayView {
@@ -34,15 +34,16 @@ - (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
3434
- (void)removeReactSubview:(UIView *)subview
3535
{
3636
[super removeReactSubview:subview];
37+
[_subviews removeObject:subview];
3738
}
3839

39-
// - (void)didMoveToSuperview
40-
// {
41-
// [super didMoveToSuperview];
42-
// if (!self.superview) {
43-
// [self invalidate];
44-
// }
45-
// }
40+
- (void)didMoveToSuperview
41+
{
42+
[super didMoveToSuperview];
43+
if (!self.superview) {
44+
[self invalidate];
45+
}
46+
}
4647

4748
- (void)didUpdateReactSubviews {
4849
if (_fallbackInMainScreen && !_window) {

0 commit comments

Comments
 (0)