File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,13 @@ - (void)shouldDismissKeyboard:(NSString *)dismissKeyboard {
147
147
- (void )setupInitialController {
148
148
UIView *initialView = self.reactSubviews [self .initialPage];
149
149
if (initialView) {
150
- UIViewController *initialController = [[UIViewController alloc ] initWithView: initialView];
150
+ UIViewController *initialController = nil ;
151
+ if (initialView.reactViewController ) {
152
+ initialController = initialView.reactViewController ;
153
+ } else {
154
+ initialController = [[UIViewController alloc ] initWithView: initialView];
155
+ }
156
+
151
157
[self .cachedControllers addObject: initialController];
152
158
153
159
[self setReactViewControllers: self .initialPage
@@ -250,7 +256,11 @@ - (UIViewController *)findAndCacheControllerForView:(UIView *)viewToDisplay {
250
256
controllerToDisplay = current;
251
257
}
252
258
if (!controllerToDisplay) {
253
- controllerToDisplay = [[UIViewController alloc ] initWithView: viewToDisplay];
259
+ if (viewToDisplay.reactViewController ) {
260
+ controllerToDisplay = viewToDisplay.reactViewController ;
261
+ } else {
262
+ controllerToDisplay = [[UIViewController alloc ] initWithView: viewToDisplay];
263
+ }
254
264
}
255
265
[self .cachedControllers addObject: controllerToDisplay];
256
266
You can’t perform that action at this time.
0 commit comments