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

242
Views
Mapa dentro del valor del mapa

Intenté mostrar para cada elemento en la matriz de datos solo la clave de nombre que necesito para mostrarla con la tabla.

 const data = [{id: "111", name: "Danny", city: "NYC"}, {id: "222", name: "Roni", city: "LDN}, {id: "333", name: "Suzi", city: "TLV", {id: "444", name: "John", city: "SF"} ] const config = [{fieldToShow: "name"}] <tbody> {data.map((row) => { return ( <tr> {config.map((value) => { return <td>{row[value.field]}</td>; })} </tr> ); })}

pero no funciono...

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

0

Su objeto de configuración tiene un campo clave fieldToShow :

 const config = [{fieldToShow: "name"}]

mientras intenta obtener el field clave en su mapa. Cambias esta línea:

 return <td>{row[value.field]}</td>;

a esto:

 return <td>{row[value.fieldToShow]}</td>;
about 4 years ago · Juan Pablo Isaza Report

0

puedes hacer esto:

 export default function Test() { const data = [ { id: '111', name: 'Danny', city: 'NYC' }, { id: '222', name: 'Roni', city: 'LDN' }, { id: '333', name: 'Suzi', city: 'TLV' }, { id: '444', name: 'John', city: 'SF' }, ]; const config = [{ fieldToShow: 'name' }]; return ( <tbody> {data.map((row) => ( <tr> {data.map((row) => ( <tr> {config.map((value) => ( <td>{row[value.fieldToShow]}</td> ))} </tr> ))} </tr> ))} </tbody> ); }
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!