# onRemove

### Definition

```javascript
function onRemove(component: HTMLElement, callback: function) {
    return HTMLElement
}
```

### Input

* `component` : the reference to a valid bolt app, a bolt functional component or a valid bold variable component
* `callback` : the function to run when the component is removed from the DOM

### Returns HTMLElement

The component will return after registering the callback which will be invoked when the component is removed
