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

318
Views
¿Cómo puedo habilitar y ocultar [lista, botón, imágenes, etc.] usando accesorios?

entonces este es el componente:

 <ReusedHeader H1headerGray="text... " H2headerRed="text2 ! " pheader="p1" getStarted="button text1" hrefab="button url 1" whatWeDo="button text2" hrefbb="button url 2" imageSrc="image url" />;

la lista en el componente:

 <li className=" hover:ring active:ring-4 w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-red-600 hover:bg-red-700 md:py-4 md:text-lg md:px-10"> {getStarted} </li>

Y este componente lo usaré en muchos lugares; en algunos lugares, quiero el componente sin botones;

¿Cómo puedo habilitar y deshabilitar los botones si es posible?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simplemente puede pasar los accesorios necesarios y manejar la lógica dentro del componente

 const ReusedHeader = ({buttonsEnabled=true}) => { if(buttonsEnabled){ // return something } else { // return something else } }

O modifique onClick si desea el mismo marcado sin la funcionalidad onClick.

 onClick={buttonsEnabled? onClick : undefined}
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!