This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React from 'react-native'; | |
const { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View | |
} = React; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React from 'react-native'; | |
// Views | |
import SwiftView from './Views/SwiftView'; | |
import ObjectiveCView from './Views/ObjectiveCView'; | |
const { | |
AppRegistry, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ReactNativeObjCViewController.h | |
@property (strong, nonatomic) NSString *route; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)reactViewObjCPressed:(id)sender { | |
ReactNativeObjCViewController *reactNativeVC = [self.storyboard instantiateViewControllerWithIdentifier:@"ReactNativeObjCVC"]; | |
reactNativeVC.route = @"routeNameObjectiveCView"; | |
[self.navigationController pushViewController:reactNativeVC animated:YES]; | |
} | |
- (IBAction)reactViewSwiftPressed:(id)sender { | |
ReactNativeSwiftViewController *reactNativeVC = [self.storyboard instantiateViewControllerWithIdentifier:@"ReactNativeSwiftVC"]; | |
reactNativeVC.route = @"routeNameSwiftView"; | |
[self.navigationController pushViewController:reactNativeVC animated:YES]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ReactNativeObjCViewController.h | |
@property (strong, nonatomic) NSString *route; | |
// ReactNativeObjCViewController.m | |
self.reactViewWrapper.data = [@{ | |
@"route": self.route, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var route: String? | |
// in viewDidLoad | |
self.reactViewWrapper.data = [ | |
“route”: self.route!, | |
“content”: “Welcome to React Native” | |
] |
OlderNewer