# @app-elements/use-mount

> A (P)React hook that calls a function after the component is mounted, and possibly when unmounted.

Latest version **0.1.1** (published 2020-11-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @app-elements/use-mount
pnpm add @app-elements/use-mount
yarn add @app-elements/use-mount
bun add @app-elements/use-mount
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-11-05 |
| First published | 2020-11-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Input Logic Team |
| Maintainers | coryschadt, trustfall, adriaanwm, staydecent |
| Keywords | react, react-component, preact, component, hook, ui |

## Links

- npm: https://www.npmjs.com/package/@app-elements/use-mount
- Repository: https://github.com/inputlogic/elements
- Homepage: https://github.com/inputlogic/elements#readme
- Issues: https://github.com/inputlogic/elements/issues
- npm.io page: https://npm.io/package/@app-elements/use-mount

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@mesalvo/react-ui](https://npm.io/package/@mesalvo/react-ui.md) — 1.7K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2020-11-05

## README

# useDocumentClick

A (P)React hook that calls a function after the component is mounted, and possibly when unmounted.

## Installation

`npm install --save @app-elements/use-mount`

## Usage

```javascript
import { useMount } from '@app-elements/use-mount'

const MyComponent = () => {
  useMount(() => alert('MOUNTED'), /* () => alert('UNMOUNTED') */)
  return null
}
```

## Props

| Prop               | Type       | Default       | Description         |
|--------------------|------------|---------------|---------------------|
| **`onMount`**      | _Function_ | _None_        | Function to invoke on component mount
| **`onUnmount`**    | _Function_ | _None_        | Function to invoke on component unmount

---
_Source: https://npm.io/package/@app-elements/use-mount · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
