wix-incubator / react-native-controllers

Native IOS Navigation for React Native (navbar, tabs, drawer)
MIT License
611 stars 82 forks source link

Compatibility with other react-native modules #40

Closed pedro closed 8 years ago

pedro commented 8 years ago

One of the challenges migrating to react-native-controllers is that a lot of the other extensions stop working, because they assume the root controller never changes (and is the top one in the window hierarchy).

To fix I had to change every single dependency to lazily fetch the root controller, and call presentedViewController on it, like:

-(UIViewController *)getRootController
{
  id<UIApplicationDelegate> appDelegate = [UIApplication sharedApplication].delegate;
  return appDelegate.window.rootViewController.presentedViewController;
}

Is there any way we can fix this more broadly from react-native-controllers itself? Or any suggestions of upstream changes that would allow this to coexist with other extensions?

Thanks!

talkol commented 8 years ago

Can you give some examples of extensions that stopped working?

drytdubs commented 8 years ago

I ran into this issue when trying to combine react-native-maps with react-native-navigation on a small side project. Admittedly, I don't have a ton of experience in fixing the native level linkings, so I was unable to get a fix myself in the time I had to work on it.

I was working on the Android side linking issue and tried following both the "manual" linking instructions and running the react-native link command.

drorbiran commented 8 years ago

This issue will be addressed in react-native-navigation #242