jabez128
jabez128

Reputation: 183

how to integrate UINavigationController with React-Native component

In my recent work, I use React-Native component as the view part of an iOS app. When I write "full native app", let's say I have button on the view, I click it and the UINavigationController would push in a new ViewController:

 UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(60, 60, 200, 60)];    
 btn.backgroundColor=[UIColor greenColor];    
 [btn setTitle:@"btn" forState:UIControlStateNormal];    
 [btn addTarget:self action:@selector(clickme:) forControlEvents:UIControlEventTouchUpInside];    
 ...

 - (void) clickme: (UIButton*) sender{
   [self.navController pushViewController:ANOTHER_VIEW_CONTROLLER animated:YES];
 }

so my question is: how can I do this in a React-Native Component?

Upvotes: 1

Views: 1995

Answers (2)

jabez128
jabez128

Reputation: 183

I solve this problem and solution is in this issue:https://github.com/facebook/react-native/issues/3324

Upvotes: 1

KChen
KChen

Reputation: 1918

this.props.navigator.push({...});

See NavigatorIOS and Navigator for more details.

Upvotes: 0

Related Questions