finds.dev← search

// the find

dai-shi/react-hooks-global-state

★ 1,102 · TypeScript · MIT · updated Aug 2023

[NOT MAINTAINED] Simple global state for React with Hooks API without Context API

A pre-Zustand experiment by the same author (dai-shi) for global state in React using hooks without Context. The README tells you to use Zustand instead, and that's the right advice. This repo's main value now is historical — it shows how the problem was approached before Zustand crystallized the API.

Shallow-equality optimization baked in by design, avoiding unnecessary re-renders without extra configuration. The key-based selector API (`useGlobalState('count')`) is genuinely ergonomic for small flat state shapes. Redux middleware compatibility meant teams could reuse thunk/logger middleware without rewriting anything. TypeScript inference from the initial state shape works correctly without boilerplate.

Explicitly unmaintained — the author redirects you to Zustand in the README, so any bug you hit stays a bug. Only optimizes one level deep, meaning nested state triggers full re-renders unless you manually flatten everything. No devtools support, no time-travel debugging, nothing the Redux ecosystem gave for free. With Zustand, Jotai, and Valtio all actively maintained by the same author, there is no reason to start a new project on this.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →