Skip to content
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

[NavigatorIOS] integration with navigator in existing native app #2442

Closed
axelg12 opened this issue Aug 26, 2015 · 5 comments
Closed

[NavigatorIOS] integration with navigator in existing native app #2442

axelg12 opened this issue Aug 26, 2015 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@axelg12
Copy link

axelg12 commented Aug 26, 2015

I been integrating React Native into my exiting application and everything has been going well.
By far my biggest problem is combining the exiting Obj-c navigator with React-Native NavigatorIOS.

Is there any way to combine the two, allowing people to navigate from the Obj-C part of the application to the new React-Native part and then back? Something like initializing the NavigatorIOS with routes from the Obj-C part.

Hope this makes a little sense

Regards

@ssssssssssss
Copy link

You may find the NavigatorIOS's backing viewcontroller and use it in your native code.

@axelg12
Copy link
Author

axelg12 commented Aug 26, 2015

Hmm I don't quite understand. Can you give some more details ?

@brentvatne
Copy link
Collaborator

@axelg12 - you'll have a hard time getting support for NavigatorIOS because most React Native developers only use the Navigator component (read about the differences here). @ssssssssssss suggestion seems to be on track, but I'm not sure that I'd recommend using this, it seems like a potentially brittle solution - I think you're better off just using a native obj-c navigator and rendering React Native views in the different routes.

@brentvatne brentvatne reopened this Aug 30, 2015
@brentvatne brentvatne changed the title NavigatorIOS with exiting app [NavigatorIOS] with exiting app Aug 30, 2015
@brentvatne brentvatne changed the title [NavigatorIOS] with exiting app [NavigatorIOS] integration with navigator in existing native app Aug 30, 2015
@ssssssssssss
Copy link

 - (RCTRootView *)sceneReactNavigator {
    UIView *parent = (UIView *)self.reactSuperview;
    while(parent != nil) {
        if([parent.nextResponder isKindOfClass:[UINavigationController class]]) {
            return (RCTRootView *)parent.nextResponder;
        }
        parent = (UIView *)parent.reactSuperview;
    }
    return nil;
}

Find view's backing navigation controller.

@brentvatne
Copy link
Collaborator

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out it's new home: https://productpains.com/post/react-native/navigatorios-integration-with-navigator-in-existing-native-app

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants