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
Limited coupons for PrimeStore's biggest sale. Claim yours before they're gone!
Claim Coupon