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

381
Views
Is there a way to trigger an event when you backspace and delete an image using slate.js?

I am using slate.js and when I delete an image by pressing backspace the image is removed from state and no longer exists. However, with the image still being stored on the server. I would like to trigger an event to delete the image from the server.

I have my image element below where I have got the image id. I want an event to be triggered on delete so I can use that id to delete the image from the backend.

export const ImageElement = ({ attributes, element }) => {

  return (
      <img
id='imageid'
        className="rounded "
        alt="uploaded image"
        src={element.url}
      />
    
  )
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In slate.js for any element that gets removed from the state. You can use component unmounts in react on the component and trigger any deletion events from there.

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!