{"id":13726423,"url":"https://github.com/dai-shi/lets-compare-global-state-with-react-hooks","last_synced_at":"2025-04-14T03:40:39.328Z","repository":{"id":50499784,"uuid":"223127672","full_name":"dai-shi/lets-compare-global-state-with-react-hooks","owner":"dai-shi","description":"Comparing global state libraries with React Hooks","archived":false,"fork":false,"pushed_at":"2021-12-25T11:27:38.000Z","size":13,"stargazers_count":58,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-27T17:38:21.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dai-shi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-21T08:41:15.000Z","updated_at":"2024-10-12T18:49:12.000Z","dependencies_parsed_at":"2022-09-21T02:24:01.835Z","dependency_job_id":null,"html_url":"https://github.com/dai-shi/lets-compare-global-state-with-react-hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Flets-compare-global-state-with-react-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Flets-compare-global-state-with-react-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Flets-compare-global-state-with-react-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Flets-compare-global-state-with-react-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dai-shi","download_url":"https://codeload.github.com/dai-shi/lets-compare-global-state-with-react-hooks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248818511,"owners_count":21166438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:03:04.104Z","updated_at":"2025-04-14T03:40:39.310Z","avatar_url":"https://github.com/dai-shi.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# Let's compare global state with React Hooks\n\nComparing global state libraries with React Hooks\n\n## Motivation\n\nI have been developing several libraries for global state with React Hooks.\nWhile developing them, I was interested in comparing with existing libraries.\nIt turns out there are various points to compare,\nshowing characteristics of such libraries.\n\nI started creating a comparison table in\n[the issue](https://github.com/dai-shi/react-tracked/issues/1).\nAs the table becomes bigger, let's create a separate repo\nso that library authors can contribute improving the comparison.\n\n## Comparison points\n\n1. Does it use React Context? What is context value?\n2. Does it use subscription for state propagation?\n3. Does it have render optimization? What is the technique?\n4. Does it have dependencies? What are they?\n5. What's the level of compatibility with concurrent rendering?\n6. Bundle size (Minified + Gzipped)\n\n### Notes\n\nRender optimization means avoiding unnecessary re-renders.\nIf a state object is `{ a: 1, b: 2 }` and a component only uses `a`,\nit won't re-render if only `b` is changed.\n\nFor \"tearing\" and \"state branching\", refer\n\u003chttps://github.com/dai-shi/will-this-react-global-state-work-in-concurrent-mode\u003e.\nThese are not necessarily problems depending on requirements.\n\n## Comparison Table\n\n\u003ctable\u003e\n\n\u003ctr\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003e1\u003c/th\u003e\n\u003cth\u003e2\u003c/th\u003e\n\u003cth\u003e3\u003c/th\u003e\n\u003cth\u003e4\u003c/th\u003e\n\u003cth\u003e5\u003c/th\u003e\n\u003cth\u003e6\u003c/th\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/dai-shi/react-tracked\"\u003ereact-tracked\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eState-based object\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eProxy-based tracking and selector function\u003c/td\u003e\n\u003ctd\u003euse-context-selector, proxy-compare\u003c/td\u003e\n\u003ctd\u003eLevel 3\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/react-tracked@1.7.5\"\u003e1.9kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/diegohaz/constate\"\u003econstate\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eState-based object\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eMultiple contexts\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eLevel 3\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/constate@3.3.0\"\u003e508B\u003ca/\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/jamiebuilds/unstated-next\"\u003eunstated-next\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eState-based object\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/unstated-next@1.1.0\"\u003e362B\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/pmndrs/zustand\"\u003ezustand\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eSelector function\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eLevel 2\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/zustand@3.6.8\"\u003e954B\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/atlassian/react-sweet-state\"\u003ereact-sweet-state\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eState-based object\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eSelector function\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/react-sweet-state@2.5.2\"\u003e3.6kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/storeon/storeon\"\u003estoreon\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eStore\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eShallow state properties\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/storeon@3.1.4\"\u003e370B\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/dai-shi/react-hooks-global-state\"\u003ereact-hooks-global-state\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eShallow state properties\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eLevel 1\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/react-hooks-global-state@1.0.2\"\u003e1.1kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/reduxjs/react-redux\"\u003ereact-redux (hooks)\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eStore\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eSelector function\u003c/td\u003e\n\u003ctd\u003eRedux\u003c/td\u003e\n\u003ctd\u003eLevel 2\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/react-redux@7.2.6\"\u003e5.4kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/ctrlplusb/easy-peasy\"\u003eeasy-peasy\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eStore\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eSelector function\u003c/td\u003e\n\u003ctd\u003eRedux, immer and so on\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/easy-peasy@5.0.4\"\u003e9.6kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/mobxjs/mobx-react-lite\"\u003emobx-react-lite\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eMutable state object\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eProxy-based tracking\u003c/td\u003e\n\u003ctd\u003eMobX\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/mobx-react-lite@3.2.2\"\u003e2kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/avkonst/hookstate\"\u003ehookstate\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eProxy-based tracking\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/@hookstate/core@3.0.13\"\u003e4.5kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/facebookexperimental/Recoil\"\u003erecoil\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eProbably rich state-based object\u003c/td\u003e\n\u003ctd\u003eYes with atom abstraction\u003c/td\u003e\n\u003ctd\u003eatoms (incl. selectors)\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eLevel 2\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/recoil@0.5.2\"\u003e21.1kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/RisingStack/react-easy-state\"\u003ereact-easy-state\u003c/a\u003e(Note: This library does not provide Hooks API)\u003c/th\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eYes with observer\u003c/td\u003e\n\u003ctd\u003eobserver\u003c/td\u003e\n\u003ctd\u003e@nx-js/observer-util\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/react-easy-state@6.1.3\"\u003e2.9kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/oleggrishechkin/react-tagged-state\"\u003ereact-tagged-state\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eSelector function with deps tracking\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/react-tagged-state@1.0.6\"\u003e804B\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/agile-ts/agile\"\u003eagile-ts\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eRuntime combining multiple rerender triggers\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eUnknown\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/@agile-ts/core@0.2.7\"\u003e12.7kB\u003ca\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/pmndrs/jotai\"\u003ejotai\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eStore\u003c/td\u003e\n\u003ctd\u003eYes, atom-based subscription\u003c/td\u003e\n\u003ctd\u003eatoms\u003c/td\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eLevel 1 / (Level 3)\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/jotai@1.4.9\"\u003e2.6kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003cth\u003e\u003ca href=\"https://github.com/pmndrs/valtio\"\u003evaltio\u003c/a\u003e\u003c/th\u003e\n\u003ctd\u003eNo\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003eProxy-based tracking\u003c/td\u003e\n\u003ctd\u003eproxy-compare\u003c/td\u003e\n\u003ctd\u003eLevel 2\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://bundlephobia.com/package/valtio@1.2.7\"\u003e2.5kB\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n## Contribution\n\nIf you have questions, suggestions or corrections, please file an issue.\n\nIf you have a new library to add, please file a pull request. Please add a new row at the end of the table.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdai-shi%2Flets-compare-global-state-with-react-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdai-shi%2Flets-compare-global-state-with-react-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdai-shi%2Flets-compare-global-state-with-react-hooks/lists"}