Created
October 31, 2017 20:09
-
-
Save alaingoldman/7dc7df6bef7ce8c272cb98bd5ad27cd5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import { | |
| StackNavigator, | |
| } from 'react-navigation'; | |
| import Login from './Login'; | |
| import Register from './Register'; | |
| const App = StackNavigator({ | |
| Login: { screen: Login }, | |
| Register: { screen: Register }, | |
| }); | |
| export default App; |
This file contains hidden or 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
| import { AppRegistry } from 'react-native'; | |
| import App from './App'; | |
| AppRegistry.registerComponent('someapp', () => App); |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { | |
| AppRegistry, | |
| StyleSheet, | |
| Text, | |
| View, | |
| TouchableHighlight, | |
| } from 'react-native'; | |
| export default class Login extends React.Component { | |
| static navigationOptions = { | |
| title: 'Login', | |
| }; | |
| linker(){ | |
| this.props.navigation.navigate("Register"); | |
| } | |
| render() { | |
| const { navigate } = this.props.navigation; | |
| return ( | |
| <View> | |
| <TouchableHighlight onPress={this.linker.bind(this)}> | |
| <Text> Login page </Text> | |
| </TouchableHighlight> | |
| </View> | |
| ); | |
| } | |
| } |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { | |
| AppRegistry, | |
| StyleSheet, | |
| Text, | |
| View | |
| } from 'react-native'; | |
| export default class Register extends React.Component { | |
| static navigationOptions = { | |
| title: 'Register', | |
| }; | |
| render() { | |
| const { navigate } = this.props.navigation; | |
| return ( | |
| <View> | |
| <Text> Register page </Text> | |
| </View> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment