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);
         
Summer Sale 2025
SUMMER SALE2025
Use coupon code PRSM25 at checkout to get 50% OFF everything in PrimeStore and PrimeBlocks.
Learn More