← All projects

react-shared-states

by @HichemTab-tech

Active 64

Global state made as simple as useState, with zero config, built-in async caching, and automatic scoping.

About this project

React Shared States Global state made as simple as useState, with zero config, built-in async caching, and automatic scoping. Tiny, ergonomic, convention‑over‑configuration state, async function, and real-time subscription sharing for React. Global by default, trivially scoped when you need isolation, and opt‑in static APIs when you must touch state outside components. As simple as useState, as flexible as Zustand, without boilerplate like Redux. 🔥 Why this instead of Redux / Zustand / Context soup? 0 config. Just pick a key: useSharedState('cart', []). Automatic scoping: nearest SharedStatesProvider wins; omit it for global. Cross‑tree sharing via named scopes (two providers with same scopeName share data) – powerful for portals/modals/micro‑frontends. Async functions become cached shared resources via useSharedFunction (built‑in loading, error, results, reentrancy guard, manual or forced refresh). Static APIs (sharedStatesApi, sharedFunctionsApi) let you prime / read / mutate outside React (SSR, event buses, dev tools, tests). No custom store objects, reducers, actions, selectors, immer, proxies, or serialization hoops. Predictable: key + scope ⇒ value. That’s it. Install or

From the project README on GitHub

Stars
64
Forks
5
License
MIT
Last push
25 May 2026

Add this badge to your README

Show that your project is listed on Made in Algeria.

Made in Algeria
[![Made in Algeria](https://www.madeinalgeria.dev/badge/react-shared-states.svg)](https://www.madeinalgeria.dev/projects/react-shared-states)

Related projects