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

139
Views
Cómo eliminar datos en vivo con reaccionar JS

Tengo algo de porquería en mi aplicación. Al react , como podemos saber, podemos hacer crud en vivo simultáneamente con la publicación de datos en la API. Como esto:

 const handleSubmit = async (someData:string) => { const result = await fetch('endpoint', {method:'POST', body:JSON.stringify(someData)}) const data = await result.json() setDatas([...datas, data]) }

Y cuando queramos eliminarlos podemos hacer esto:

 const handleDelete = async (id:string) => { const result = await fetch('endpoint', {method:'DELETE'}) const data = await result.json() setDatas(datas.filter(data => data.id !== id)) }

Pero si queremos agregar datos y luego eliminarlos sin actualizar, no puedo eliminar los datos porque no puedo encontrar la identificación. ¿Cómo lo hago?

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!