# react-will-mount-hook

> Mock react willMount with react hooks api

Latest version **1.0.1** (published 2021-05-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-will-mount-hook
pnpm add react-will-mount-hook
yarn add react-will-mount-hook
bun add react-will-mount-hook
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-05-02 |
| First published | 2020-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liuyunjs |
| Maintainers | liuyunjs |

## Links

- npm: https://www.npmjs.com/package/react-will-mount-hook
- Repository: https://github.com/liuyunjs/react-will-mount-hook
- Homepage: https://github.com/liuyunjs/react-will-mount-hook#readme
- Issues: https://github.com/liuyunjs/react-will-mount-hook/issues
- npm.io page: https://npm.io/package/react-will-mount-hook

## Recent versions

- 1.0.1 (latest) — 2021-05-02
- 1.0.0 — 2021-05-02
- 0.0.3 — 2020-08-09
- 0.0.2 — 2020-01-02

## README

# react-will-mount-hook

一个模拟类组件 componentWillMount 生命周期的 hook
只会执行一次

## 安装

```
    npm install react-will-mount-hook --save

    or

    yarn add react-will-mount-hook
```

## 示例

```javascript
import * as React from 'react';
import { View, Text } from 'react-native';
import useWillMount from 'react-will-mount-hook';

export default () => {
  const [count, setCount] = React.useState(0);

  useWillMount(() => {
    console.log('useWillMount hook');
  });

  React.useEffect(() => {
    setCount(count + 1);
  }, []);

  return (
    <View>
      <Text>{count}</Text>
    </View>
  );
};
```

---
_Source: https://npm.io/package/react-will-mount-hook · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
