# effector-react

> React bindings for effector

Latest version **23.3.0** (published 2024-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install effector-react
pnpm add effector-react
yarn add effector-react
bun add effector-react
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 23.3.0 |
| Published | 2024-12-11 |
| First published | 2018-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=11.0.0 |
| Dependencies | 1 |
| Unpacked size | 322.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4853 |
| Author | Zero Bias |
| Maintainers | drelliot, kireevmp, sergeysova, lobatik, zero_bias, drevoed, goodmind |
| Keywords | react, hooks, business, logic, data, flow, state management, state manager, algebraic effects, model, reactive, state, frp, event, effect, functional, store |

## Links

- npm: https://www.npmjs.com/package/effector-react
- Repository: https://github.com/effector/effector
- Homepage: https://effector.dev
- Issues: https://github.com/effector/effector/issues?q=is:issue+label:effector-react,effector-react%2Fscope
- Funding: https://www.patreon.com/zero_bias
- npm.io page: https://npm.io/package/effector-react

## Dependencies (1)

- [use-sync-external-store](https://npm.io/package/use-sync-external-store.md) ^1.0.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 23.3.0 (latest) — 2024-12-11
- 23.0.0 (next) — 2023-11-28
- 22.5.4 (previous) — 2023-09-12
- 23.2.1 — 2024-05-23
- 23.2.0 — 2024-02-07
- 23.1.0 — 2023-12-16
- 23.0.1 — 2023-12-01
- 23.0.0-rc.6 — 2023-11-22
- 23.0.0-rc.5 — 2023-11-18
- 23.0.0-rc.4 — 2023-10-18
- 23.0.0-rc.3 — 2023-10-10
- 23.0.0-rc.2 — 2023-10-10
- 23.0.0-rc.1 — 2023-10-04
- 22.5.3 — 2023-05-17
- 22.5.2 — 2023-05-15
- … 129 more at https://npm.io/package/effector-react/versions

## README

# effector-react

React bindings for [effector](https://www.npmjs.com/package/effector)

## Installation

```bash
npm install --save effector effector-react
```

Or using `yarn`

```bash
yarn add effector effector-react
```

## Usage

```js
import {createStore, combine, createEvent} from 'effector'

import {useUnit} from 'effector-react'

const inputText = createEvent()

const $text = createStore('').on(inputText, (_, text) => text)

const $size = $text.map(text => text.length)

const Form = () => {
  const {text, size} = useUnit({
    text: $text,
    size: $size,
  })
  const handleTextChange = useUnit(inputText)

  return (
    <form>
      <input
        type="text"
        onChange={e => handleTextChange(e.currentTarget.value)}
        value={text}
      />
      <p>Length: {size}</p>
    </form>
  )
}
```

[Try it](https://share.effector.dev/gjsgk6oh)

[useUnit](https://effector.dev/docs/api/effector-react/useUnit) in docs
[Units](https://effector.dev/docs/glossary#unit) in docs
[createStore](https://effector.dev/docs/api/effector/createStore) in docs
[createEvent](https://effector.dev/docs/api/effector/createEvent) in docs

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