📄 primereact/hooks/useupdateeffect

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

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

Introducing PrimeReact v11 Alpha 🥁Learn More

useUpdateEffect

Executes a given callback when a stateful property is updated.

Import#


import { useUpdateEffect } from 'primereact/hooks';
         

Copy

Basic#


Updating the value at blur event triggers a message.

const toast = useRef(null);
const [value, setValue] = useState('');

useUpdateEffect(() => {
    toast.current.show({ severity: 'info', summary: 'Updated' });
}, [value]);
         

Copy

  • Import

  • Basic

PrimeReact 10.9.7 by PrimeTek