Question: Hook for component destroyed

Hello, this is just a question:

Is there any plan to implement a hook for when a component is destroyed? Something like beforeDestroy and Destroyed Vue hooks.

Or is there an event that is fired when the component is destroying.

I’m asking because I’m working with pagination and nested components, and I want to run some scripts when the child livewire component is being destroyed to mount the new one.


see if this is what you need


Well, I tried but this is the problem. I added an id to the child component’s div, and in the hook for element.removed I check if the element has that id, but when it does have the id the component that the function receives is the parent and not the child, and I need the child component’s name in my JS script.