onDelete Method for SPFx web part
Provide an onDelete() method that occurs when a web part is deleted from a page. This will allow for the web part to remove any files related to the instance being deleted.
See discussion on:
Thanks for your feedback! We like your suggestion and it’s being added to our backlog. We don’t have yet specific schedule for this, but item has been added to upcoming plans for the SPFx and since request does make sense and has been requested from other sources as well, this will be most likely implemented.
Stephen Wilson commented
this is sorely needed. any updates?
Rob Pearmain commented
This would be awesome
Any updates since the first official reply ?
An event handler for cleanup when the web part is removed would be very handy.