Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 电子邮件和密码don';我不能通过各州进入消防基地_Javascript_Firebase_React Native_Firebase Authentication - Fatal编程技术网

Javascript 电子邮件和密码don';我不能通过各州进入消防基地

Javascript 电子邮件和密码don';我不能通过各州进入消防基地,javascript,firebase,react-native,firebase-authentication,Javascript,Firebase,React Native,Firebase Authentication,我发现了一个错误:每当我使用登录表单时,电子邮件的格式都很糟糕,密码也无法到达firebase 以下是错误屏幕截图: 以下是登录表单的代码: class LoginView extends React.Component { constructor(props) { super(props); this.state = { email : '', password: '', name:'', phone:

我发现了一个错误:每当我使用登录表单时,电子邮件的格式都很糟糕,密码也无法到达firebase

以下是错误屏幕截图:

以下是登录表单的代码:

    class LoginView extends React.Component {
  


  constructor(props) {
    super(props);
    this.state = {
      email   : '',
      password: '',
      name:'',
      phone:'',
      fontsLoaded:false,
      isLoading: false,
    }
  }
  async componentDidMount(){
    await Font.loadAsync({
      'comfortaa':require('./assets/fonts/Comfortaa/static/Comfortaa-Bold.ttf'),
    });
    this.setState({fontsLoaded:true})
  }
  updateInputVal = (val, prop) => {
    const state = this.state;
    state[prop] = val;
    this.setState(state);
  }

  registerUser = () => {
    if(this.state.email === '' && this.state.password === '') {
      Alert.alert('Enter details to signup!')
    } else {
      this.setState({
        isLoading: true,
      })
      console.log(this.state.email);
      firebase
      .auth()
      .createUserWithEmailAndPassword(this.state.email, this.state.password)
      .then((res) => {
        res.user.updateProfile({
          name: this.state.name
        })
        console.log('User registered successfully!')
        this.setState({
          isLoading: false,
          name: '',
          email: '', 
          password: ''
        })
        this.props.navigation.navigate('Login')
      })
      .catch(error => {
        this.setState({ errorMessage: error.message });
        console.log(`Exception in registerUser:${error.message}`);
      })
    }
  }

有没有办法修复这个错误和密码错误?

console.log(this.state.email)的输出是什么?什么都没有,这就是问题所在当我输入电子邮件和密码时,没有任何信息会传递给firebaseFlow wise,您会希望在第一个语句中使用
如果(this.state.email==''this.state.password==''){
为什么?它会发生什么变化?