Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

382
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda