Skip to content

Instantly share code, notes, and snippets.

@spencercarli
Last active February 14, 2016 20:51
Show Gist options
  • Save spencercarli/247c26bbc5a3e02574da to your computer and use it in GitHub Desktop.
Save spencercarli/247c26bbc5a3e02574da to your computer and use it in GitHub Desktop.
Meteor Authentication from React Native - UI: Sign In - loggedIn.js
// RNApp/app/loggedIn.js
/*
* Removed from snippet for brevity
*/
export default React.createClass({
/*
* Removed from snippet for brevity
*/
handleSignOut() {
ddpClient.logout(() => {
this.props.changedSignedIn(false)
});
},
render() {
let count = Object.keys(this.state.posts).length;
return (
<View>
<Text>Posts: {count}</Text>
<Button text="Increment" onPress={this.handleIncrement}/>
<Button text="Decrement" onPress={this.handleDecrement}/>
<Button text="Sign Out" onPress={() => this.props.changedSignedIn(false)} />
</View>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment