useUnmountEffect

コンポーネントがアンマウントされたときに、指定されたコールバックを実行します。


import { useUnmountEffect } from 'primereact/hooks';
         

ボックスがアンマウントされると、ブラウザコンソールにメッセージが表示されます。

マウント済み

useUnmountEffect(() => {
    toast.current && toast.current.show({ severity: 'info', summary: 'Unmounted' });
});