Created
June 29, 2017 21:46
-
-
Save aaronblondeau/524f62f78b522147eede53aad2b51802 to your computer and use it in GitHub Desktop.
where2ride home screen updated to utilize application state.
This file contains 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
/** | |
* 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