In my code is showing an error and i don´t know why… I am learnig react and javascript so…
import React, { useState } from ‘react’;
import { auth } from ‘../firebase.config’;
import { signInWithEmailAndPassword } from ‘firebase/auth’;
import { useRouter } from ‘expo-router’;
import { Text } from “react-native”;
import { StyledBody, StyledBox, StyledInput, StyledBemVindo, StyledButtonLogin, StyledSpam, StyledSignUp, } from ‘./CSS’;
function LogoV() {
return (
<img width=”50″ height=”50″ src=”https://img.icons8.com/ios-filled/50/v-symbol.png” alt=”v-symbol”
style={{ width: ‘10%’, height: ‘15%’, display: ‘block’, margin: ‘auto’ }}
/>)
};
const Login = () => {your text
const [email, setEmail] = useState(”);
const [password, setPassword] = useState(”);
const router = useRouter(”);
function SignUp() {
router.replace(‘/componentes/FormSignUp’)
}
function userLogin() {
signInWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
const user = userCredential.user;
router.replace(‘/componentes/ChatBase’)
})
.catch((error) => {
alert(“User or Password incorrect, try again!”);
})
}
return (
Welcome
<StyledInput
type=”text”
id=”emailbox”
placeholder=’Email Adress’
value={email}
autoComplete=”email”
onChange={(e) => setEmail(e.target.value)}
required />
<StyledInput
type=”password”
placeholder=”Password”
value={password}
onChange={(e) => setPassword(e.target.value)}
id=”passwordbox”
required />
Login
Don´t have an account?
Sign Up
);
};
export default Login;
Éric Favero is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.