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

246
Views
¿Cómo mostrar la 'Alerta' de la interfaz de usuario de Chakra?

Estoy tratando de mostrar el mensaje de Alerta usando Chakra Ui pero no se muestra. Por favor ayuda.

 .catch((error) => { const errorCode = error.code; const errorMessage = error.message; console.log(errorMessage, errorCode); <Alert status='error'> <AlertIcon /> <AlertTitle>Error!</AlertTitle> <AlertDescription>Email/ Password Did Not Matched.</AlertDescription> </Alert> });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Los componentes como <Alert /> no se pueden agregar a la captura de una promesa. Debe generar la alerta de forma condicional en la declaración de devolución de un componente de la siguiente manera:

 function LoginExample() { const [showAlert, setShowAlert] = useState(false) const handleLogin = (email, password) => { loginUser(email, password) .then((res) => /* handle success */) .catch((error) => { const errorCode = error.code; const errorMessage = error.message; console.log(errorMessage, errorCode); setShowAlert(true) }) } return ( <> {showAlert && ( <Alert status='error'> <AlertIcon /> <AlertTitle>Error!</AlertTitle> <AlertDescription>Email/ Password Did Not Matched.</AlertDescription> </Alert> )} {/* rest of jsx */} </> ) }

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!