useUnmountEffect

Executes a given callback when component is unmounted.


import { useUnmountEffect } from 'primereact/hooks';
         

A messages is displayed at browser console when the box is unmounted.

Mounted

useUnmountEffect(() => {
    toast.current && toast.current.show({ severity: 'info', summary: 'Unmounted' });
});
         
November Sale 2025
Apply coupon code ENDOFYEAR25 at checkout to enjoy 25% off your order.
Buy Now