Skip to content

Instantly share code, notes, and snippets.

@aaronblondeau
Last active August 26, 2017 19:15
Show Gist options
  • Save aaronblondeau/f9e63c279b0ed71c99a7e5d8af0dec4c to your computer and use it in GitHub Desktop.
Save aaronblondeau/f9e63c279b0ed71c99a7e5d8af0dec4c to your computer and use it in GitHub Desktop.
Initial version of where2ride home screen component
import React, { Component } from 'react';
import {
StyleSheet,
} from 'react-native';
import { Container, Content, Button, Text } from 'native-base';
import {observer} from 'mobx-react';
import applicationState from '../ApplicationState'
@observer
export default class HomeScreen extends Component {
static navigationOptions = ({ navigation }) => ({
title: 'React Native Quickly',
});
render() {
const { navigate } = this.props.navigation;
return (
<Container>
<Content>
<Button onPress={() => applicationState.clicks = applicationState.clicks + 1 }>
<Text>Get Stuff!</Text>
</Button>
<Text>{ applicationState.clicks }</Text>
<Button onPress={() => navigate('Detail', { name: 'Thing 2', description: "It is a thing." }) }>
<Text>Open</Text>
</Button>
</Content>
</Container>
);
}
}
const styles = StyleSheet.create({
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment