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 });
});