Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

344
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!