Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

341
Vistas
Login Component Error on React.js (codesandbox attached)

I am a new programmer and I recently started following a Login Form tutorial, and I am experiencing a couple of issues with it.

Project Overview:

As previously described, it is a login form made with create-react-app. The objective is for the user to be able to login, if it is successful, it will log "Logged In" on the console. If there are errors or if its unsuccessful, it will log "Details Do Not Match".

The Problem:

Though I followed this tutorial line-by-line, there is an unseen error in my code that causes the console to log "Details Do Not Match". I am curious to see where I might have written the code incorrectly.

Below I've attached a working Codesandbox link of my code:

https://codesandbox.io/s/project-zi3un5

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You had a minor typo on line 17. You were comparing details.email to adminUser instead of adminUser.email

It should read:

if (details.email === adminUser.email && details.password === adminUser.password) {
  console.log("Logged In");
  setUser({
    name: details.name,
    email: details.email
});

Here's a fixed version: https://codesandbox.io/s/project-forked-nvmmyn

demo

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda