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

252
Views
Formulario REACT de varios pasos: el botón Siguiente no funciona y el primer círculo ya está en verde

Soy principiante en REACT y estoy tratando de crear un formulario de varios pasos en React. ¿Cómo escondo el botón ATRÁS de la primera página (ver la imagen, por favor)?

ingrese la descripción de la imagen aquí

 export default function StepperControl({ handleClick, currentStep, steps }) { return ( <div className="container mt-4 mb-8 flex justify-around"> <button onClick={() => handleClick()} className={`cursor-pointer rounded-xl border-2 border-slate-300 bg-white py-2 px-4 font-semibold uppercase text-slate-400 transition duration-200 ease-in-out hover:bg-slate-700 hover:text-white ${currentStep === 1 ? " cursor-not-allowed opacity-50 " : "" }`} > Back </button> <button onClick={() => handleClick("next")} className="cursor-pointer rounded-lg bg-blue-700 py-2 px-4 font-semibold uppercase text-white transition duration-200 ease-in-out hover:bg-slate-700 hover:text-white" > {currentStep === steps.length - 1 ? "Confirm" : "Next"} </button> </div> ); }

Muchas gracias por su ayuda

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Supongo que esto es lo que necesitas.

 export default function StepperControl({ handleClick, currentStep, steps }) { return ( <div className="container mt-4 mb-8 flex justify-around"> { currentStep > 1 && <button onClick={() => handleClick()} className={`cursor-pointer rounded-xl border-2 border-slate-300 bg-white py-2 px-4 font-semibold uppercase text-slate-400 transition duration-200 ease-in-out hover:bg-slate-700 hover:text-white cursor-not-allowed opacity-50`} > Back </button> } <button onClick={() => handleClick("next")} className="cursor-pointer rounded-lg bg-blue-700 py-2 px-4 font-semibold uppercase text-white transition duration-200 ease-in-out hover:bg-slate-700 hover:text-white" > {currentStep === steps.length - 1 ? "Confirm" : "Next"} </button> </div> ); }

Además, debe enviar currentStep como un número/entero, no como un objeto.

about 4 years ago · Santiago Gelvez 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!