📄 primereact/hooks/useunmounteffect

File: useunmounteffect.md | Updated: 11/15/2025

Source: https://primereact.org/hooks/useunmounteffect/

Introducing PrimeReact v11 Alpha 🥁Learn More

useUnmountEffect

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