@buildinams/use-is-mounted
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

use-is-mounted

NPM version Actions Status PR Welcome

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.

Package Sidebar

Install

npm i @buildinams/use-is-mounted

Weekly Downloads

163

Version

0.0.1

License

MIT

Unpacked Size

11.2 kB

Total Files

21

Last publish

Collaborators

  • paulomfj
  • _brunotome_
  • buildinamsterdam