reactjs-Firebase登录react不会发生任何事情
发布时间:2022-03-09 17:35:57 471
相关标签: # node.js
when i click on the Login with google nothing happens and if I try to Login with the email and password it give me this error
无效的钩子调用。钩子只能在函数组件的主体内部调用。发生这种情况的原因如下:
- React和渲染器的版本可能不匹配(例如React DOM)
- 你可能违反了钩子的规则
- 同一个应用程序中可能有多个React副本
it says it is on line 62
import {
Button,
Center,
chakra,
FormControl,
FormLabel,
Heading,
Input,
Stack,
useToast,
} from "@chakra-ui/react";
import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import { Card } from "../components/Card";
import DividerWithText from "../components/DividerWithText";
import { Layout } from "../components/Layout";
import { useAuth } from "../contexts/AuthContext";
export default function ForgotPasswordPage() {
const navigate = useNavigate;
const { forgotPassword } = useAuth();
const toast = useToast();
const [email, setEmail] = useState("");
return (
Forgot password
{
e.preventDefault();
// your login logic here
try {
await forgotPassword(email);
toast({
description: `An email is sent to ${email} for password reset instructions.`,
status: "success",
duration: 9000,
isClosable: true,
});
} catch (error) {
console.log(error.message);
toast({
description: error.message,
status: "error",
duration: 9000,
isClosable: true,
});
}
}}
>
Email address
setEmail(e.target.value)}
/>
OR
);
}
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报