Skip to content

Instantly share code, notes, and snippets.

@aaronblondeau
Created June 29, 2017 21:46
Show Gist options
  • Save aaronblondeau/524f62f78b522147eede53aad2b51802 to your computer and use it in GitHub Desktop.
Save aaronblondeau/524f62f78b522147eede53aad2b51802 to your computer and use it in GitHub Desktop.
where2ride home screen updated to utilize application state.
/**
* where2ride React Native App
* https://github.com/aaronblondeau/where2ride
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
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 where2ride extends Component {
render() {
return (
<Container>
<Content>
<Button onPress={() => applicationState.clicks = applicationState.clicks + 1 }>
<Text>Find Rides!</Text>
</Button>
<Text>{ applicationState.clicks }</Text>
</Content>
</Container>
);
}
}
const styles = StyleSheet.create({
});
AppRegistry.registerComponent('where2ride', () => where2ride);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment