Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Last active June 16, 2016 14:21
Show Gist options
  • Save fakenickels/637d7575fd970759e4f9c2538475719c to your computer and use it in GitHub Desktop.
Save fakenickels/637d7575fd970759e4f9c2538475719c to your computer and use it in GitHub Desktop.
Testing article
import React from 'react';
import {
View,
Text,
TextInput,
TouchableHighlight,
} from 'react-native';
import Meteor from 'react-native-meteor';
import { Actions } from 'react-native-router-flux';
export default class Login extends React.Component {
constructor(props){
super(props);
this.state = {
email: null,
password: null,
};
}
render(){
return (
<View>
<TextInput
secureTextEntry={true}
onChangeText={val => this.setState({email: val})}
/>
<TextInput
keyboardType="secure"
onChangeText={val => this.setState({password: val})}
/>
<TouchableHighlight
onPress={this._login.bind(this)}
/>
</View>
);
},
_login(){
const { email, password } = this.state;
Meteor.loginWithPassword(email, password, error => {
if(error) return;
Actions.dashboard();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment