I have a modal component and I want to be able to destroy it when the user clicks on the x button, I also have a notification popup that destroys itself after an interval but I'd like to give the user the ability to close it with the x button too. I know I can pass an event to the component but I think it'll be better if the component is self destructive. Also there might be a better design for such case but that's the way I thought about it, other pointers will be appreciated.