Skip to content

Instantly share code, notes, and snippets.

@spencercarli
Created February 12, 2016 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spencercarli/87740b708daecec488cc to your computer and use it in GitHub Desktop.
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
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