📄 primereact/hooks/usemounteffect

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

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

Introducing PrimeReact v11 Alpha 🥁Learn More

useMountEffect

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