# react-hooks-force-update

> Tiny hook to support forceUpdate() behaviour.

Latest version **0.0.1** (published 2023-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-hooks-force-update
pnpm add react-hooks-force-update
yarn add react-hooks-force-update
bun add react-hooks-force-update
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2023-03-03 |
| First published | 2023-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | zvs001 |
| Keywords | react, react-hooks, hooks, use-force-refresh, use-force-update, force-refresh |

## Links

- npm: https://www.npmjs.com/package/react-hooks-force-update
- Repository: https://github.com/zvs001/react-hooks-force-update
- Homepage: https://github.com/zvs001/react-hooks-force-update#readme
- Issues: https://github.com/zvs001/react-hooks-force-update/issues
- npm.io page: https://npm.io/package/react-hooks-force-update

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2023-03-03

## README

Tiny hook to support forceUpdate() behaviour.

[![npm](https://img.shields.io/npm/v/react-hooks-force-update)](https://www.npmjs.com/package/react-hooks-force-update)

## Install

``yarn add react-hooks-force-update``

or 

```npm i -S react-hooks-force-update```

## Usage


```tsx
import useForceUpdate from 'react-hooks-force-update'
import {useEffect} from "react";

function App() {
  const [value, forceUpdate] = useForceUpdate()

  console.log('App render')
  
  useEffect(() => {
    console.log('useEffect is updated')
  }, [value])

  useEffect(() => {
      const interval = setInterval(() => forceUpdate(), 1000)
      return () => clearInterval(interval)
  })
}
```

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