简体   繁体   English

为什么我的注册页面即使我正确输入了我的火基代码也不起作用

[英]why my sign up page don't work even i enter my fire base code correctly

when i try to sign up this error appear当我尝试注册时出现此错误

this.props.firebase.signupwithemail is not a function.(In'_this.props.firebase.signupWithEmail(email,password)', '_this.props.firebase.signupWithEmail'is undefined) this.props.firebase.signupwithemail 不是函数。(在'_this.props.firebase.signupWithEmail(email,password)', '_this.props.firebase.signupWithEmail'未定义)

that's my code那是我的代码

handleOnSignup = async (values, actions) => {
const { name, email, password } = values

try {
  const response = await this.props.firebase.signupWithEmail(
    email,
    password
  )

  if (response.user.uid) {
    const { uid } = response.user
    const userData = { email, name, uid }
    await this.props.firebase.createNewUser(userData)
    this.props.navigation.navigate('App')
  }
} catch (error) {
  // console.error(error)
  actions.setFieldError('general', error.message)
} finally {
  actions.setSubmitting(false)
}

Change this:改变这个:

this.props.firebase.signInWithEmail

into this:进入这个:

this.props.firebase.signInWithEmailAndPassword

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM