Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why closing a page does not unmount the component

I know there is normally unmounting the child in a parent and it's not okay to unmount a child itself. But I am just curious about it that why the unloading (closing the page) will not trigger the unmount event. Something interesting behind this design? I looked around but found nothing till now.

Thank you for any idea provided here!

Best wishes, Hearen.

like image 833
Hearen Avatar asked Oct 24 '25 19:10

Hearen


1 Answers

Closing the page will actually discard the main process/thread which handles the rendering of the web page. In that case, there is actually no way of calling the unmounting method since the thread which calls that method is discarded.

like image 128
Sajith Edirisinghe Avatar answered Oct 26 '25 08:10

Sajith Edirisinghe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!