# react-hook-usemutable

> Utilities to use the mutableJS library with React

Latest version **1.0.1** (published 2025-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-hook-usemutable
pnpm add react-hook-usemutable
yarn add react-hook-usemutable
bun add react-hook-usemutable
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2025-04-21 |
| First published | 2023-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nikita 'donnikitos' Nitichevski |
| Maintainers | donnikitos |
| Keywords | react, mutableJS, mutables, signals, mutable, reactivity |

## Links

- npm: https://www.npmjs.com/package/react-hook-usemutable
- Repository: https://github.com/donnikitos/react-hook-useMutable
- Homepage: https://github.com/donnikitos/react-hook-useMutable#readme
- Issues: https://github.com/donnikitos/react-hook-useMutable/issues
- npm.io page: https://npm.io/package/react-hook-usemutable

## 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

- 1.0.1 (latest) — 2025-04-21
- 1.0.0 — 2024-02-03
- 0.5.5 — 2023-07-06
- 0.5.41 — 2023-07-05
- 0.5.4 — 2023-06-30
- 0.5.3 — 2023-06-30
- 0.5.2 — 2023-06-30
- 0.5.1 — 2023-06-29
- 0.5.0 — 2023-06-29

## README

# react-hook-usemutable

[![npm](https://img.shields.io/npm/dt/react-hook-usemutable?style=for-the-badge)](https://www.npmjs.com/package/react-hook-usemutable) [![GitHub Repo stars](https://img.shields.io/github/stars/donnikitos/react-hook-useMutable?label=GitHub%20Stars&style=for-the-badge)](https://github.com/donnikitos/react-hook-useMutable) [![GitHub](https://img.shields.io/github/license/donnikitos/react-hook-useMutable?color=blue&style=for-the-badge)](https://github.com/donnikitos/react-hook-useMutable/blob/master/LICENSE)
[![GitHub last commit](https://img.shields.io/github/last-commit/donnikitos/react-hook-useMutable?style=for-the-badge)](https://github.com/donnikitos/react-hook-useMutable) [![Issues](https://img.shields.io/github/issues/donnikitos/react-hook-useMutable?style=for-the-badge)](https://github.com/donnikitos/react-hook-useMutable/issues)

A utility to simplify the use of the [@mutableJS/core](https://www.npmjs.com/package/@mutablejs/core) reactivity with React.

## Installation

Install with **npm**:

```bash
    npm install @mutablejs/core react-hook-usemutable
```

Install with **yarn**:

```bash
    yarn add @mutablejs/core react-hook-usemutable
```

Keep in mind the repository depends on the `@mutablejs/core` package.

## Usage/Examples

**initialize inside of components**

```typescript
import { mutable } from '@mutablejs/core';
import useMutable from 'react-hook-usemutable';

const magicValue = mutable(0);

// Demoing value change
setInterval(() => {
	magicValue.value++;
}, 500);

function ShowSomeMagic() {
	const value = useMutable(magicValue);

	return `Current value: ${value}`;
}
```

**As a state container / store**

```typescript
import { mutable } from '@mutablejs/core';
import { createUseMutable } from 'react-hook-usemutable';

const magicValue = mutable(0);

const useMagicValue = createUseMutable(magicValue);

// Demoing value change
setInterval(() => {
	magicValue.value++;
}, 500);

function ShowSomeMagic() {
	const value = useMagicValue();

	return `Current value: ${value}`;
}
```

## Authors

-   [@donnikitos](https://www.github.com/donnikitos)

## Feedback

Any feedback? Join our [Discord server](https://discord.gg/gNdgy8uS3R) and reach out to us.\
We are open to suggestions, ideas and collaboration.

## Support

Love open source? Enjoying my project?\
Your support can keep the momentum going! Consider a donation to fuel the creation of more innovative open source software.

| via Ko-Fi                                                                         | Buy me a coffee                                                                                                                                                 | via PayPal                                                                                                                                                             |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y2ALMG) | <a href="https://www.buymeacoffee.com/donnikitos" target="_blank"><img src="https://nititech.de/donate-buymeacoffee.png" alt="Buy Me A Coffee" width="174"></a> | <a href="https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW" target="_blank"><img src="https://nititech.de/donate-paypal.png" alt="PayPal" width="174"></a> |

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