useMounted

Hook to get mounted state of component.

Install all hooks via:

npm install @styple/hooks

or copy the source:

import { useEffect, useState } from "react";
export const useMounted = () => {
const [mounted, setMounted] = useState<boolean>(false);
useEffect(() => {
setMounted(true);
}, []);
return mounted;
};