https://github.com/umijs/hox
State sharing for React components.
https://github.com/umijs/hox
react react-hooks reactjs state-management
Last synced: 7 days ago
JSON representation
State sharing for React components.
- Host: GitHub
- URL: https://github.com/umijs/hox
- Owner: umijs
- License: mit
- Created: 2019-10-16T06:16:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T16:11:06.000Z (about 1 year ago)
- Last Synced: 2025-04-01T00:35:58.343Z (14 days ago)
- Topics: react, react-hooks, reactjs, state-management
- Language: TypeScript
- Homepage: https://hox.js.org
- Size: 2.93 MB
- Stars: 1,460
- Watchers: 29
- Forks: 98
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-state - hox - generation state manager for React. (react)
- awesome - umijs/hox - generation state manager for React. (React / State Management)
- awesome-react-cn - hox
README
# Hox
State sharing for React components.
[](https://www.npmjs.com/package/hox)
[](https://www.npmjs.com/package/hox)
[English Doc](https://hox.js.org) · [中文文档](https://hox.js.org/zh/)
> This is the documentation for hox v2. If you are looking for the v1 doc, please go [here](https://github.com/umijs/hox/blob/v1/README.md).
## Play Hox in Codesandbox
[](https://codesandbox.io/s/github/awmleer/todo-app-with-hox/tree/master/)
## Install
```shell
npm install --save hox
# or
yarn add hox
# or
pnpm add hox
```## Why Hox?
- Direct reuse of existing React knowledge, almost no learning cost, how you write React components, you can write Store
- Designed for flexible refactoring, using the same DSL in Store and components allows you to convert a component's local state into a state shared between components at almost zero cost
- Supports both local and global states, a good balance between flexibility and simplicity
- Excellent performance and TypeScript support