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

90
Views
¿Cómo uso setstate en múltiples y uno no afectará al otro?

Estoy creando Accodion que tendrá varios elementos con TÍTULO y CUERPO.

Cuando se hace clic en un título, quiero que setShow verdadero. Pero cuando el artículo A es verdadero, no quiero que el artículo B sea verdadero al mismo tiempo. Obtendré esos datos del servidor y no sé cómo tendré mis artículos en el futuro.

 const Accordion = ({ title, text }) => { const [show, setShow] = React.useState(false); return ( <> <div className="accordion-wrapper"> <div onClick={() => setShow(!show)} className="accordion-title cursor-pointer flex flex-row flex-1 justify-between items-center" > <div className="title-text"> <h2>{title}</h2> </div> <div className="title-icon"></div> </div> <div className="accordion-content">{text}</div> </div> </> ); }; export default Accordion;
about 4 years ago · Juan Pablo Isaza
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!