File: useunmounteffect.md | Updated: 11/15/2025
Introducing PrimeReact v11 Alpha 🥁Learn More
SearchK
10.9.7
HOOK
API
Executes a given callback when component is unmounted.
Import#
import { useUnmountEffect } from 'primereact/hooks';
Copy
Basic#
A messages is displayed at browser console when the box is unmounted.
Unmounted
Mounted
Unmount
useUnmountEffect(() => {
toast.current && toast.current.show({ severity: 'info', summary: 'Unmounted' });
});
Copy
Import
Basic
PrimeReact 10.9.7 by PrimeTek