I'm building an editor using the excellent Slate editor, but I'm having trouble with a certain task. I've built a drag-and-drop image upload that successfully uploads images (via API, not related to Slate) and inserts them into the editor. However, I want to delete the image from the server if the user deletes it in the editor. Is there a way to trigger functions when a certain node
type is removed from the state
?
Trigger event when a certain element has been removed
1.1k Views Asked by Adam Gerthel At
1
I've just started looking at slate and was looking into the same issue. My solution is to:
(options) => { /* plugin object */}
schema.nodes
, return a wrapper around my mainImage
component that sets anonDelete
prop from the options parameter.