javascript - 为什么即使我正确输入了我的基本代码,我的注册页面也不起作用
问题描述
当我尝试注册时出现此错误
this.props.firebase.signupwithemail 不是函数。(在'_this.props.firebase.signupWithEmail(email,password)', '_this.props.firebase.signupWithEmail'未定义)
这是我的代码
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)
}
解决方案
改变这个:
this.props.firebase.signInWithEmail
进入这个:
this.props.firebase.signInWithEmailAndPassword
推荐阅读
- javascript - 如何仅使用 webpack 5 编译一个打字稿文件并排除其他所有内容?
- ruby - 如何解决 macOS 上的 gem install pg 错误
- python - 将 HTML 转换为 CSV 或 XLS 以进行 SSIS 平面文件上传
- kubernetes - 在 Kubernetes 中使用 Helm GitLab-Runner 进行带有自签名证书的 Gitlab 和 Docker Registry(x509 错误)
- stream - 区分 RTCPeerConnection 远端的轨道种类
- sql - SQL 日期场景,用于在本月 1 日获取上个月的数据,然后在上个月下降
- database-design - 重复用户的数据库结构
- javascript - Vanilla 等价于 wrapInner() 用于在 li 中放置标签(无序列表)
- r - R:如何按最近的单个时间日期连接两个数据表?
- html - 表格行的高度不变