useIsMounted
Custom hook that determines if the component is currently mounted.
Installation
npx sse-tool add use-is-mounted
npm install sse-hooks
Usage
import { useIsMounted } from "./{hooks file}";
const isComponentMounted = useIsMounted();
// Use isComponentMounted() to check if the component is currently mounted before performing certain actions.
import { useIsMounted } from "sse-hooks";
const isComponentMounted = useIsMounted();
// Use isComponentMounted() to check if the component is currently mounted before performing certain actions.
API
Return Value
Returns Function.
A function that returns a boolean value indicating whether the component is mounted.