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

218
Views
¿Cómo puedo mapear y mostrar los resultados filtrados en ReactJS?

Este es el código en función (mi activador es el botón) El filtro es filterKeyword y nameArea: projectData es el resultado de los datos de la API onload

 function filter() { let filteredResults = projectData.filter(f => f.ProjectName.includes(filterKeyword) && f.PartitionKey.includes(nameArea)); console.log(filteredResults); const filteredList = filteredResults.map((item) => <li> key={item.RowKey} </li> ); return ( <ul>{filteredList}</ul> ); };

Este es el índice de matriz de FilteredResults:

 [ { "RowKey": "6934", "ProjectName": "Sku portfolio optimization Industrial Adhesives Systems (IAS)", "LeadDivision": "All Safety & Industrial Division", "LeadBusiness": "Safety & Industrial Business Group", "PartitionKey": "EMEA", "people": [] } ]

El error en la consola:

 index.js:1 Warning: Each child in a list should have a unique "key" prop.

ACTUALIZACIÓN: lo obtuve en el mapeo pero este es el formato:

 const filteredList = filteredResults.map((item, index) => <li key={index}>{item.RowKey}{item.ProjectName}{item.PartitionKey}{item.ProjectStatus}</li> );

Obtuve los 4 índices en la matriz de niños.

 0: $$typeof: Symbol(react.element) key: "0" props: children: Array(4) 0: "6934" 1: "Sku portfolio optimization Industrial Adhesives Systems (IAS)" 2: "EMEA" 3: "Tracking Complete" length: 4 [[Prototype]]: Array(0) key: (...) get key: ƒ () [[Prototype]]: Object ref: null type: "li" _owner: null _store: {validated: false} _self: undefined .....
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 const filteredList = filteredResults.map((item, index) => <li key={index}>{item.RowKey}</li> );

Prueba 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!