You can you see my code below. How can I use React Firebase auth from React Firebase hook?
export const Login = () => {
const [sendPasswordResetEmail, sending] = useSendPasswordResetEmail(auth);
const Navigat = useNavigate();
let erromessage;
const emialInput = useRef('');
const passwordInput = useRef('');
let location = useLocation();
let from = location.state?.from?.pathname || "/";
const [
signInWithEmailAndPassword,
user,
loading,
error,
] = useSignInWithEmailAndPassword(auth);
if (user) {
Navigat(from, { replace: true });
}
console.log(error)
const FromSubmit = (event) => {
event.preventDefault();
const email = emialInput.current.value;
const password = passwordInput.current.value;
console.log('email', email, 'apssword', password)
signInWithEmailAndPassword(email, password)
toast('log in sucess')
}
if (error) {
erromessage = <div>
<p className='text-danger'>Try Again </p>
</div>
}