Skip to content

useMount

Runs the provided callback function when the component mounts.

Usage

import { useMount } from "@frend-digital/ui/hooks";
import React from 'react'
export const Component = () => {
useMount(() => {
const handleSomething = () => {
// do something
}
window.addEventListener("scroll", handleSomething);
return () => {
window.removeEventListener("scroll", handleSomething);
}
})
return (
...
)
}