Skip to content

Instantly share code, notes, and snippets.

@HigoRibeiro
Last active May 29, 2018 17:35
Show Gist options
  • Save HigoRibeiro/6b0cd3c5edb613747b9d59792ec4c1c0 to your computer and use it in GitHub Desktop.
Save HigoRibeiro/6b0cd3c5edb613747b9d59792ec4c1c0 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { View, Button, Text } from 'react-native';
import { createStackNavigator } from 'react-navigation';
const Page1 = ({ navigation }) => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Home ;D</Text>
<Button title={() => { navigation.navigate('About'); }} />
</View>
);
Page1.navigationOptions = {
title: 'Home',
};
const Page2 = () => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>About</Text>
</View>
);
Page2.navigationOptions = {
title: 'About',
};
export default createStackNavigator({
Home: Page1,
About: Page2,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment