Advertisement
Guest User

App.js

a guest
May 17th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import {
  3.   StyleSheet,
  4.   Text,
  5.   View,
  6. } from 'react-native';
  7.  
  8. import {createStackNavigator} from 'react-navigation';
  9.  
  10. class FristScreen extends React.Component{
  11.   static navigationOptions = { header: null}
  12.   render(){
  13.     const {navigate} = this.props.navigation;
  14.     return(
  15.         <View>
  16.         <Text>First page...</Text>
  17.         </View>
  18.     );
  19.   };
  20. }//end
  21.  
  22.  
  23. class SecondScreen extends React.Component{
  24.   static navigationOptions = { header: null}
  25.   render(){
  26.     const {navigate} = this.props.navigation;
  27.     return(
  28.         <View>
  29.         <Text>Second page...</Text>
  30.         </View>
  31.     );
  32.   };
  33. }//end
  34.  
  35.  
  36. const NavigationApp = createStackNavigator(
  37.   {
  38.     First: {screen: FirstScreen},
  39.     Second: {screen: SecondScreen},
  40.   }
  41. );
  42.  
  43. export default class App extends React.Component {
  44.   render() {
  45.     return <NavigationApp/>;
  46.   }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement