Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
How to Sign up new users using Firebase V9 & React?

My goal is the sign up new users with email and passwords using firebase v9. I have been reading their documentation and gotten this far. I need help with the createUserWithEmailAndPassword function.

import React, {useState} from 'react';

import { getAuth, createUserWithEmailAndPassword } from "firebase/auth";

function SignUp() {
    const [email, setEmail] = useState("");
    const [password, setPassword] = useState("");

    const auth = getAuth();

    createUserWithEmailAndPassword(auth, email, password)
    .then((userCredential) => {
        // Signed in 
        const user = userCredential.user;
       ** // ... LOST HERE ... HOW DO I CODE THIS PART // **
    })
    .catch((error) => {
        const errorCode = error.code;
        const errorMessage = error.message;
     **   // .. LOST HERE ... HOW DO I CODE THIS PART // **
    });

    return (
        <div className="container">
            <div className="sign-up">
                <h1>SignUp</h1>
                <form>
                    <label>Email</label>
                    <input type="email"
                    name="email" 
                    placeholder="email" 
                    value={email}
                    onChange={(e) => setEmail(e.target.value)}
                    />
                    <label>Password</label>
                    <input 
                    type="password" 
                    name="password" 
                    placeholder="Password" 
                    value={password}
                    onChange = {(e) => setPassword(e.target.value)}    
                    />
                    <button type="submit">Sign Up</button>
                </form>
            </div>
        </div>
    )
};
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda