Created
February 12, 2016 02:17
-
-
Save spencercarli/87740b708daecec488cc to your computer and use it in GitHub Desktop.
Easily Connect React Native to a Meteor Server - Setting up the React Native App - index.js
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
import React, { | |
View, | |
Text, | |
StyleSheet | |
} from 'react-native'; | |
import Button from './button'; | |
export default React.createClass({ | |
getInitialState() { | |
return { | |
connected: false, | |
posts: {} | |
} | |
}, | |
handleIncrement() { | |
console.log('inc'); | |
}, | |
handleDecrement() { | |
console.log('dec'); | |
}, | |
render() { | |
let count = 10; | |
return ( | |
<View style={styles.container}> | |
<View style={styles.center}> | |
<Text>Posts: {count}</Text> | |
<Button text="Increment" onPress={this.handleIncrement}/> | |
<Button text="Decrement" onPress={this.handleDecrement}/> | |
</View> | |
</View> | |
); | |
} | |
}); | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
backgroundColor: '#F5FCFF', | |
}, | |
center: { | |
alignItems: 'center' | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment