import React, { Component } from "react"; import { TextInput, TouchableWithoutFeedback, Keyboard, ImageBackground, Text, View } from "react-native"; import firebase from "firebase"; import { Picker } from "@react-native-picker/picker"; import { styles } from "../config/styles"; import CustomButton from "../components/CustomButton"; export default class RegisterScreen extends Component { constructor(props) { super(props); this.state = { username: '', email: '', password: '', interpreter: false, }; this.onRegister = this.onRegister.bind(this) }; onRegister() { const { username, email, password, interpreter } = this.state; firebase.auth().createUserWithEmailAndPassword(email, password) .then((result) => { firebase.firestore().collection("Users") .doc(firebase.auth().currentUser.uid) .set({ username, email, interpreter, }) console.log(result) }) .catch((error) => { console.log(error) }) } render() { return ( this.setState({ username })}/> this.setState({ email })}/> this.setState({ password })} secureTextEntry={ true }/> Are you an interpreter? this.setState({interpreter: itemValue})}> this.onRegister()}/> ); } }