File: useupdateeffect.md | Updated: 11/15/2025
Introducing PrimeReact v11 Alpha 🥁Learn More
SearchK
10.9.7
HOOK
API
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