useHasMounted
A custom React hook that determines if a component has mounted on the client side. This is useful for ensuring that certain hooks or components that rely on window or document objects are only executed in the client environment, especially useful in Next.js or other SSR frameworks.
Code
API
Return
boolean - Returns true if the component has mounted on the client side, false otherwise.