{"id":22454375,"url":"https://github.com/littensy/react-reflex","last_synced_at":"2026-03-10T02:02:26.673Z","repository":{"id":222753927,"uuid":"758289234","full_name":"littensy/react-reflex","owner":"littensy","description":"♻️ React hooks and components for Reflex","archived":false,"fork":false,"pushed_at":"2025-05-14T03:51:46.000Z","size":161,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T06:54:39.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Luau","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/littensy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-16T01:52:32.000Z","updated_at":"2025-08-26T15:12:08.000Z","dependencies_parsed_at":"2025-08-17T07:09:49.047Z","dependency_job_id":"f275983a-fc26-41e5-83d4-5040f0eb3b0a","html_url":"https://github.com/littensy/react-reflex","commit_stats":null,"previous_names":["littensy/react-reflex"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/littensy/react-reflex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littensy%2Freact-reflex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littensy%2Freact-reflex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littensy%2Freact-reflex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littensy%2Freact-reflex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/littensy","download_url":"https://codeload.github.com/littensy/react-reflex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littensy%2Freact-reflex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30322635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-06T07:07:32.105Z","updated_at":"2026-03-10T02:02:26.644Z","avatar_url":"https://github.com/littensy.png","language":"Luau","readme":"\u003cp align=\"center\"\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg width=\"150\" height=\"150\" src=\"images/logo.png\" alt=\"Logo\"\u003e\n  \u003c/p\u003e\n  \u003ch1 align=\"center\"\u003e\u003cb\u003eReact Reflex\u003c/b\u003e\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    An all-in-one state container.\n    \u003cbr /\u003e\n    \u003ca href=\"https://npmjs.com/package/@rbxts/react-reflex\"\u003e\u003cstrong\u003enpm package →\u003c/strong\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/littensy/react-reflex/ci.yml?style=for-the-badge\u0026branch=master\u0026logo=github)\n[![NPM Version](https://img.shields.io/npm/v/@rbxts/react-reflex.svg?style=for-the-badge\u0026logo=npm)](https://www.npmjs.com/package/@rbxts/react-reflex)\n[![GitHub License](https://img.shields.io/github/license/littensy/react-reflex?style=for-the-badge)](LICENSE.md)\n\n\u003c/div\u003e\n\n**Reflex** is a simple state container inspired by [Rodux](https://github.com/roblox/rodux) and [Silo](https://github.com/sleitnick/rbxts-silo), designed to be an all-in-one solution for managing and reacting to state in Roblox games.\n\n**React Reflex** provides React hooks and components for Reflex using either [`@rbxts/react`](https://github.com/littensy/rbxts-react) or [`jsdotlua/react`](https://github.com/jsdotlua/react-lua).\n\nSee the [React Reflex documentation](https://littensy.github.io/reflex/docs/guides/roact-reflex/) for more information.\n\n## 📦 Setup\n\n### TypeScript\n\nInstall the `@rbxts/react-reflex` package using your package manager of choice.\n\n```sh\nnpm install @rbxts/react-reflex\nyarn add @rbxts/react-reflex\npnpm add @rbxts/react-reflex\n```\n\n### Wally\n\nAdd `littensy/react-reflex` to your `wally.toml` file.\n\n```toml\n[dependencies]\nReactReflex = \"littensy/react-reflex@VERSION\"\n```\n\n## 🚀 Examples\n\n### Mounting your app\n\nUse `\u003cReflexProvider\u003e` to enable Reflex hooks and components:\n\n```tsx\nimport React, { StrictMode } from \"@rbxts/react\";\nimport { createPortal, createRoot } from \"@rbxts/react-roblox\";\nimport { ReflexProvider } from \"@rbxts/react-reflex\";\n\nconst root = createRoot(new Instance(\"Folder\"));\n\nroot.render(\n\t\u003cStrictMode\u003e\n\t\t\u003cReflexProvider producer={producer}\u003e\n\t\t\t{/* Your app */}\n\t\t\t{createPortal(\u003cApp /\u003e, playerGui)}\n\t\t\u003c/ReflexProvider\u003e\n\t\u003c/StrictMode\u003e,\n);\n```\n\n### Typed hooks\n\nCustom hooks can be created to provide typed hooks for your state:\n\n```tsx\nimport { useProducer, useSelector, UseProducerHook, UseSelectorHook } from \"@rbxts/react-reflex\";\n\nexport const useRootProducer: UseProducerHook\u003cRootProducer\u003e = useProducer;\nexport const useRootSelector: UseSelectorHook\u003cRootProducer\u003e = useSelector;\n```\n\n### Counter\n\n```tsx\nimport React from \"@rbxts/react\";\nimport { useRootProducer, useRootSelector } from \"./hooks\";\n\nexport function Counter() {\n\tconst producer = useRootProducer();\n\tconst count = useRootSelector((state) =\u003e state.count);\n\n\treturn (\n\t\t\u003ctextbutton\n\t\t\tText={`Count: ${count}`}\n\t\t\tAnchorPoint={new Vector2(0.5, 0.5)}\n\t\t\tSize={new UDim2(0, 100, 0, 50)}\n\t\t\tPosition={new UDim2(0.5, 0, 0.5, 0)}\n\t\t\tEvent={{\n\t\t\t\tActivated: () =\u003e producer.increment(),\n\t\t\t\tMouseButton2Click: () =\u003e producer.decrement(),\n\t\t\t}}\n\t\t/\u003e\n\t);\n}\n```\n\n## 📚 Resources\n\n- [Reflex Documentation](https://littensy.github.io/reflex/) - Learn about Reflex's core concepts and API\n- [Reflex Repository](https://github.com/littensy/reflex) - The official Reflex repository\n- [React Lua Documentation](https://jsdotlua.github.io/react-lua/) - A comprehensive guide for the differences between Roact and React\n\n## 📝 License\n\nThis project is licensed under the [MIT license](LICENSE).\n","funding_links":[],"categories":["Hooks"],"sub_categories":["React-Reflex \u003cimg src=\"luau.svg\" width=\"18px\" /\u003e\u003cimg src=\"roblox-ts.svg\" width=\"18px\" /\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittensy%2Freact-reflex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flittensy%2Freact-reflex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittensy%2Freact-reflex/lists"}