useGetIsMounted

About

Checks if a component is mounted or not at the time. Useful for async effects

Examples

Basic usage

import { useEffect } from "react";
import { useGetIsMounted } from "rooks";
export default function App() {
  const getIsMounted = useGetIsMounted();
  useEffect(() => {
    alert("Mounted " + String(getIsMounted()));
  }, []);
  return null;
}

Join the community!

Join our discord server! You can click the floating discord icon at the bottom right of the screen and chat with us!

Powered by vercel