title: React-Native: Dismiss/Exit React-Native View back to Native
body: <p>I have an existing app that I am working on integrating React-Native for a portion of it. I am
  having trouble understanding how to 'exit' react-native and get back to a native view.</p>
  
  <p>Here's some code:</p>
  
  <pre><code>// Main objective-c code that bootstraps the react-native view. This view is loaded as a modal view.
  MainViewController.m:
  
  - (void)viewDidLoad {
      [super viewDidLoad];
  
      RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"IndexApp" initialProperties:props launchOptions:nil];
  
      rootView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height-49);
      [self.view addSubview:rootView];
  
  }
  </code></pre>
  
  <p>My initial react views are such:</p>
  
  <pre><code>render() {
    return (
        &lt;Navigator
            style={styles.container}
  ...
  </code></pre>
  
  <p>I have a right-nav button on the Navigator that I would like to "dismiss" the react view and the underlying MainViewController native view.</p>
  
  <p>I have tried a callback to MainViewController from the react view like so, but without avail:</p>
  
  <pre><code>RCT_EXPORT_METHOD(dismiss:(NSString *)name location:(NSString *)location)
  {
      NSLog(@"dismiss...");
      // these don't do anything
      //[self dismissViewControllerAnimated:YES completion:nil];
      //[self.navigationController popViewControllerAnimated:YES];
      // anything with _rootView doesn't do anything, i.e. _rootView removeFromSuperview];
  
  }
  </code></pre>
  
  <p>Any help with an approach to 'exit' the react-native view and get back into native views would be appreciated.</p>