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

207
Views
En jsx use map () para representar elementos, el mismo código primero no se puede representar, pero el segundo sí.

En este proyecto utilicé NextJS JSX.

Intento usar la función map () para convertir el elemento de matriz en un enlace. En el retorno, el primer mapa () no muestra nada , pero *** el segundo mapa () muestra enlaces y se muestra en el navegador.

Estas dos piezas de map() son iguales, no tengo idea de por qué solo funciona el segundo map().

 import Link from 'next/link' import { Fragment } from 'react' import Nav from '../components/nav' const Home = () =>{ let navList = ["Home", "Project", "blog", "About"] return( <Fragment> { navList.map((navItem) => { navItem === "Home" ? <Link href="/" key={navItem}><a>{navItem}</a></Link> : <Link href={`../${navItem}`} key={navItem}><a>{navItem}</a></Link> }) } { navList.map((navItem) => ( navItem === "Home" ? <Link href="/" key={navItem}><a>{navItem}</a></Link> : <Link href={`../${navItem}`} key={navItem}><a>{navItem}</a></Link> )) } </Fragment> ) } export default Home;
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!