# @opentf/react-state

> A global state manager for ReactJS.

Latest version **0.16.0** (published 2024-03-30) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @opentf/react-state
pnpm add @opentf/react-state
yarn add @opentf/react-state
bun add @opentf/react-state
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.16.0 |
| Published | 2024-03-30 |
| First published | 2023-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Thanga Ganapathy |
| Maintainers | ganapathy |
| Keywords | react, state, store, manager, global, shared |

## Links

- npm: https://www.npmjs.com/package/@opentf/react-state
- Repository: https://github.com/Open-Tech-Foundation/react-state
- Homepage: https://react-app-state.pages.dev
- Issues: https://github.com/Open-Tech-Foundation/react-state/issues
- npm.io page: https://npm.io/package/@opentf/react-state

## Dependencies (3)

- [immer](https://npm.io/package/immer.md) ^10.0.4
- [@opentf/std](https://npm.io/package/@opentf/std.md) ^0.3.0
- [use-sync-external-store](https://npm.io/package/use-sync-external-store.md) 1.2.0

## 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.16.0 (latest) — 2024-03-30
- 0.16.0-next.0 (next) — 2024-03-29
- 0.15.0 — 2024-02-15
- 0.14.1 — 2024-02-02
- 0.14.0 — 2024-02-02
- 0.13.1 — 2023-04-24
- 0.13.0 — 2023-04-19
- 0.12.1 — 2023-04-13
- 0.12.0 — 2023-03-28
- 0.11.2 — 2023-03-24
- 0.11.1 — 2023-03-24
- 0.11.0 — 2023-03-24

## README

<img align="left" src="https://open-tech-foundation.pages.dev/img/Logo.svg" width="50" height="50">

&nbsp;[OPEN TECH FOUNDATION](https://open-tech-foundation.pages.dev/)

<div align="center">

# React State

[![Build](https://github.com/open-tech-foundation/react-state/actions/workflows/build.yml/badge.svg)](https://github.com/open-tech-foundation/react-state/actions/workflows/build.yml)

</div>

> A global state manager for React.

<div align="center">

# [View Demo](https://react-app-state.pages.dev/#demo) | [Documentation](https://react-app-state.pages.dev/)

</div>

## Features

- Simple API
- Mutable State Updates
- No Context Providers
- Auto Shallow Diff Computed Props
- TypeScript Support

## Installation

```shell
npm install @opentf/react-state
```

```shell
yarn add @opentf/react-state
```

```shell
pnpm add @opentf/react-state
```

```shell
bun add @opentf/react-state
```

## Usage

```jsx
import { create } from '@opentf/react-state';

const { useAppState, setAppState, api } = create({ count: 0 });

api.subscribe(console.log);

export default function App() {
  const count = useAppState((s) => s.count);

  return (
    <>
      <p>Count: {count}</p>
      <button
        onClick={() =>
          setAppState((s) => {
            s.count++;
          })
        }
      >
        Increment
      </button>
    </>
  );
}
```

## Related

- [@opentf/react-form](https://react-form.pages.dev/) - A simple form state manager for React.

- [@opentf/react-sandbox](https://github.com/Open-Tech-Foundation/react-sandbox) - The CodeSandbox sandpack wrapper with additional features.

- [@opentf/react-node-repl](https://node-repl.pages.dev/) - The Node.js REPL in a React component.

- [@opentf/std](https://js-std.pages.dev/) - An Extensive JavaScript Standard Library.

## License

Copyright (c) 2021, [Thanga Ganapathy](https://github.com/Thanga-Ganapathy) ([MIT License](../../LICENSE)).

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