File: usemounteffect.md | Updated: 11/15/2025
Introducing PrimeReact v11 Alpha 🥁Learn More
SearchK
10.9.7
HOOK
API
Executes a given callback when component is mounted.
Import#
import { useMountEffect } from 'primereact/hooks';
Copy
Basic#
A message is displayed when the component is mounted.
Mounted
View the Toast message at top right.
useMountEffect(() => {
toast.current.show({ severity: 'info', summary: 'Mounted', sticky: true });
});
Copy
Import
Basic
PrimeReact 10.9.7 by PrimeTek