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

111
Views
Filtrando la matriz con objetos pero no filtra la matriz

A continuación se muestra mi estado en el componente funcional de Reactjs

 let valueByFilterInitState = [{ filterType: "Organization", value: "Micro", id: "15" }, { filterType: "Vehicle", value: "Bmw", id: "13" }] const [filterListValue, setFilterListValue] = useState(valueByFilterInitState)

Aquí estoy tratando de filtrar la lista pero no filtra y devuelve la misma matriz

 const chipHandler = (list) => { setFilterListValue(filterListValue => { const copy = [...filterListValue] let test = copy.filter((val) => { if (val.value === list.value) { return { filterType: val.filterType, value: "", id: "" } } return val }) return test }) }

Aquí estoy representando esos filterListValue

 <div style={{ display: "flex", justifyContent: "start", alignItems: "start", columnGap: 4 }}> { filterListValue.filter((selectedFilter) => selectedFilter.id !== "").map((list, index) => { return (<Chip variant="outlined" label={list.value} onDelete={() => chipHandler(list, index)} />) }) } </div>
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!