# react-doura

> Doura React.js integration

Latest version **0.2.2** (published 2026-05-13) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2026-05-13 |
| First published | 2022-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 99.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Maintainers | liximomo |
| Keywords | doura, reactive, state management, javascript, typescript, react |

## Links

- npm: https://www.npmjs.com/package/react-doura
- Repository: https://github.com/dourajs/doura
- Homepage: https://dourajs.github.io/doura
- Issues: https://github.com/dourajs/doura/issues
- npm.io page: https://npm.io/package/react-doura

## 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.2.2 (latest) — 2026-05-13
- 0.2.0-beta.2 (beta) — 2026-05-10
- 0.2.1 — 2026-05-12
- 0.2.0 — 2026-05-12
- 0.2.0-beta.1 — 2026-05-09
- 0.2.0-beta.0 — 2026-05-08
- 0.1.2 — 2026-04-24
- 0.1.1 — 2026-04-14
- 0.1.0 — 2026-04-13
- 0.0.13 — 2023-08-24
- 0.0.12 — 2023-08-04
- 0.0.11 — 2023-04-10
- 0.0.10 — 2023-03-29
- 0.0.9 — 2023-03-13
- 0.0.8 — 2023-02-24
- … 10 more at https://npm.io/package/react-doura/versions

## README

<div align="center">
<h1>doura</h1>
</div>

Doura is a decentralized state management solution based on the concept of model. It's very simple and intuitive.

- 🔑 100% TypeScript Support
- ⚛️ Reactive and Immutable
- 🔗 Models are organized in a decentralized way

<hr />

## Installation

Install with npm:

```
npm install doura
```

## Usage

### Define Model

```tsx
import { defineModel } from 'doura'
import { useModel } from 'react-doura'

const todoModel = defineModel({
  state: {
    todos: [
      {
        id: 0,
        text: 'read books',
        isFinished: true,
      },
    ],
    /** @type {'all' | 'unfinished'} */
    filter: 'all',
  },
  views: {
    unfinishedTodos() {
      // autocompletion! ✨
      return this.todos.filter((todo) => !todo.isFinished)
    },
    filteredTodos() {
      if (this.filter === 'unfinished') {
        return this.unfinishedTodos
      }
      return this.todos
    },
  },
  actions: {
    // any amount of arguments, return a promise or not
    setFilter(filter) {
      // you can directly mutate the state
      this.filter = filter
    },
    // action can be asynchronous
    async getTodos() {
      this.todos = await fetchTodos('httpds://api.example.com/todos')
    }
  },
})
```

### Bind to React Components

```tsx
import { useModel } from 'react-doura'

export function TodoApp() {
  // type of `filteredTodos` and `setFilter` are inferred automatically
  const { filteredTodos, setFilter } = useModel(todoModel)

  return (
    <div>
      <div>
        <input
          type="checkbox"
          id="filter"
          onClick={(event) =>
            setFilter(event.target.checked ? 'unfinished' : 'all')
          }
        />
        <label htmlFor="filter">Only show unfinished</label>
      </div>
      <ul>
        {filteredTodos.map((todo) => (
          <li key={todo.id}>
            <input type="checkbox" checked={todo.isFinished} />
            {todo.text}
          </li>
        ))}
      </ul>
    </div>
  )
}
```

## For AI Agents

Machine-readable documentation: https://dourajs.github.io/doura/llms.txt

## Credits

Doura is greatly inspired by following excellent projects:

- [Immer](https://github.com/immerjs/immer)
- [Vue.js](https://github.com/vuejs)
- [Pinia](https://github.com/vuejs/pinia)

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