useTimeout

Executed a given callback after a certain delay.


import { useTimout } from 'primereact/hooks';
         

Wait for 3 seconds to view the Toast message.

A message will be displayed in 3 seconds after mount.

const [clearTimeout] = useTimeout(() => {
    toast.current.show({ severity: 'info', summary: 'Loaded' });
}, 3000);