useMountEffect

Executes a given callback when component is mounted.


import { useMountEffect } from 'primereact/hooks';
         

A message is displayed when the component is mounted.

View the Toast message at top right.

useMountEffect(() => {
    toast.current.show({ severity: 'info', summary: 'Mounted', sticky: true });
});
         
Summer Sale 2025
SUMMER SALE2025
Use coupon code PRSM25 at checkout to get 50% OFF everything in PrimeStore and PrimeBlocks.
Learn More