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

104
Views
Reaccionar paso de estado a una función de mapa

Necesito pasar un estado a una función de mapa

 const MenuList = ({login, ìsAuthenticated}) => { const [isAuthenticated] = useState(true) menuItem.items.push(isAuthenticated) console.log(menuItem) const navItems = menuItem.items.map((item) => { switch (item.type) { case 'group': return <NavGroup key={item.id} item={item} />; case 'authGroup': if (ìsAuthenticated){ return <NavGroup key={item.id} item={item} />; }else{ return <div/>; }

Este es mi código real

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

0

Tienes que agregar más código. ¿Quieres pasar el estado como parámetro del mapa? o dentro del comando de cambio?

También isAuthenticated es un accesorio en su componente y después de crear una nueva variable const con el mismo nombre. ¿Por qué haces esto?

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!