-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Integration w/ Existing App] How to pass the native navigation controller into a react-native root view component? #1422
Comments
help! help! |
Hi @iostalk! Can you explain the use case and provide some sample code for how you would like to use this from the React Native side? |
In MainController.m, I set a ReactRootView instance as a root view, and I have a navigation Controller already in objective-c side: UIViewController *myViewController = [[MyViewController alloc] init];
navigationController = [[UINavigationController alloc]
initWithRootViewController:myViewController];
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.rootViewController = navigationController;
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName: @"SimpleApp"
launchOptions:nil];
myViewController.view = rootView;
[window makeKeyAndVisible]; In jsx: render: function() {
return (
<NavigatorIOS
initialRoute={{
component: MyView,
title: 'My View Title',
passProps: { myProp: 'foo' },
}}
/>
);
},
...
this.props.navigator.push(nextRoute); My question is, can I get the navigator in the js side? |
@iostalk - I haven't tried that myself, this is probably a better question for StackOverflow now that I see it, could you repost it there? If you don't get an answer, ping me here and I can reopen and see if someone on the team can help you. 😄 |
@iostalk Did you find out how to get the navigator in the js side ? |
I am wondering the same? |
I meet the similar problem and my solution is in this issue: #3324 wish could help you :) |
I have a navigation controller already, I want to pass the navigation controller into the react-native root view, how to implement this?
The text was updated successfully, but these errors were encountered: