import React, { Component } from "react"; import { TextInput, TouchableWithoutFeedback, Keyboard, ImageBackground, Image } from "react-native"; import firebase from "firebase"; import { styles } from "../config/styles"; import CustomButton from "../components/CustomButton"; export default class LoginScreen extends Component { constructor(props) { super(props); this.state = { email: '', password: '', }; this.onLogin = this.onLogin.bind(this) }; onLogin() { const { email, password } = this.state; firebase.auth().signInWithEmailAndPassword(email, password).then((result) => {console.log(result)}).catch((error) => {console.log(error)}) } render() { return ( this.setState({ email })}/> this.setState({ password })} secureTextEntry={ true }/> this.onLogin()}/> this.props.navigation.navigate('Register')}/> ); } }