📄 primereact/hooks/usetimeout

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

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

Introducing PrimeReact v11 Alpha 🥁Learn More

useTimeout

Executed a given callback after a certain delay.

Import#


import { useTimeout } from 'primereact/hooks';
         

Copy

Basic#


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);
         

Copy

  • Import

  • Basic

PrimeReact 10.9.7 by PrimeTek