Skip to content

Commit a63d381

Browse files
authored
iOS: waitForRender option is ignored in 8.x (#8144)
#8126
1 parent 13aa616 commit a63d381

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/ios/RNNReactView.mm

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,17 @@ - (instancetype)initWithHost:(RCTHost *)host
7878
- (void)surface:(__unused RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage {
7979
RCTExecuteOnMainQueue(^{
8080
[super surface:surface didChangeStage:stage];
81-
[self reactViewReady];
81+
[[NSNotificationCenter defaultCenter] addObserver:self
82+
selector:@selector(contentDidAppear:)
83+
name:RCTContentDidAppearNotification
84+
object:nil];
8285
});
8386
}
87+
88+
- (void)contentDidAppear:(NSNotification *)notification {
89+
[self reactViewReady];
90+
}
91+
8492
#else
8593

8694
- (void)contentDidAppear:(NSNotification *)notification {
@@ -96,9 +104,9 @@ - (void)reactViewReady {
96104
_reactViewReadyBlock();
97105
_reactViewReadyBlock = nil;
98106
}
99-
#ifndef RCT_NEW_ARCH_ENABLED
107+
100108
[[NSNotificationCenter defaultCenter] removeObserver:self];
101-
#endif
109+
102110
}
103111

104112
#pragma mark - RNNComponentProtocol

0 commit comments

Comments
 (0)