use-is-mounted
Hook to check if effectively the component is mounted.
Introduction
This hook allow to check if effectively the component is mounted.
Installation
Install this package with npm
.
npm i @buildinams/use-is-mounted
Usage
To use this hook, simply import it and use it like a normal React hook.
import React from 'react';
import useIsMounted from '@buildinams/use-is-mounted';
const MyComponent = () = {
const isMounted = useIsMounted();
...
}
API
On first render this hooks returns false
and then returns true
once is mounted.
Requirements
This library requires a minimum React version of 17.0.0
.
Requests and Contributing
Found an issue? Want a new feature? Get involved! Please contribute using our guideline here.