useUnmountEffect
コンポーネントがアンマウントされたときに、指定されたコールバックを実行します。
インポート#
import { useUnmountEffect } from 'primereact/hooks';
ボックスがアンマウントされると、ブラウザコンソールにメッセージが表示されます。
useUnmountEffect(() => {
toast.current && toast.current.show({ severity: 'info', summary: 'Unmounted' });
});