{"id":22803622,"url":"https://github.com/Neohertz/react-crate","last_synced_at":"2025-08-10T04:31:52.584Z","repository":{"id":267516042,"uuid":"901442177","full_name":"Neohertz/react-crate","owner":"Neohertz","description":"React hooks for @rbxts/crate.","archived":false,"fork":false,"pushed_at":"2024-12-11T21:49:03.000Z","size":1690,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T03:31:09.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neohertz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-12-10T17:01:49.000Z","updated_at":"2024-12-11T21:49:07.000Z","dependencies_parsed_at":"2024-12-10T20:34:16.952Z","dependency_job_id":null,"html_url":"https://github.com/Neohertz/react-crate","commit_stats":null,"previous_names":["neohertz/crate-react"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Neohertz/react-crate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neohertz%2Freact-crate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neohertz%2Freact-crate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neohertz%2Freact-crate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neohertz%2Freact-crate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neohertz","download_url":"https://codeload.github.com/Neohertz/react-crate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neohertz%2Freact-crate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269677380,"owners_count":24457845,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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-12T10:01:02.054Z","updated_at":"2025-08-10T04:31:52.574Z","avatar_url":"https://github.com/Neohertz.png","language":"TypeScript","funding_links":[],"categories":["State Management"],"sub_categories":["Crate \u003cimg src=\"roblox-ts.svg\" width=\"18px\" /\u003e"],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Neohertz/react-crate\"\u003e\u003cimg width=\"150\" height=\"150\" src=\"./docs/images/react-crate-logo.png\" alt=\"Crate\"\u003e\u003c/a\u003e\n\t\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003e\n\tReact Crate\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n    \u003cb\u003e\n        A hook library to integrate \u003ca href=\"https://github.com/Neohertz/crate\"\u003e@rbxts/crate\u003c/a\u003e with react-lua.\n    \u003c/b\u003e\n\u003ch4\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Downloads][downloads-shield]][downloads-url]\n[![Contributors][contributors-shield]][contributors-url]\n[![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url]\n[![License][license-shield]][license-url]\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#-notice\"\u003eNotice\u003c/a\u003e •\n    \u003ca href=\"#-installation\"\u003eInstallation\u003c/a\u003e •\n    \u003ca href=\"#-usage\"\u003eUsage\u003c/a\u003e •\n    \u003ca href=\"https://docs.neohertz.dev/docs/crate/about#%EF%B8%8F-react-integration\"\u003eDocumentation\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n# 📛 Notice\n\n\u003e [!CAUTION] \n\u003e This package is still in **early beta**, expect breaking changes\n\n# 💻 Installation\n\n###  Dependancies\n\n```bash\n@rbxts/crate@^1.0.1\n@rbxts/react@^17.2.3\n```\n\n\n### Install\nTo install crate, run one of the following commands in your project's directory.\n\n```bash\nnpm i @rbxts/react-crate\nyarn add @rbxts/react-crate\npnpm add @rbxts/react-crate\n```\n\n# 💫 Usage\n\nLets assume we have the following crate.\n\n```ts\nimport { Crate } from \"@rbxts/crate\"\n\nexport const sharedCrate = new Crate({\n  coins: 0,\n  xp: 0,\n});\n```\n\nTo use this crate with react, we can simply use the provided `useCrate()` hook.\n\n```tsx\nimport { sharedCrate } from \"./example/path\";\nimport { useCrate } from \"@rbxts/react-crate\";\n\nexport function MyCrateComponent() {\n  const coins = useCrate(sharedCrate, (state) =\u003e state.coins);\n  const xp = useCrate(sharedCrate, (state) =\u003e state.xp);\n\n  useEffect(() =\u003e {\n    print(`XP updated to ${xp}!`);\n  }, [xp]);\n\n  return (\n      \u003ctextlabel \n        Size={UDim2.fromOffset(200, 50)} \n        Text={`${coins}`} \n      /\u003e\n    )\n}\n```\n\n## Bindings\n\nThis library provides a hook for using the state as a binding if you prefer.\n\n```tsx\nimport { sharedCrate } from \"./example/path\";\nimport { useCrateBinding } from \"@rbxts/react-crate\";\n\nexport function MyCrateComponent() {\n  const coins = useCrateBinding(sharedCrate, (state) =\u003e state.coins);\n\n  return (\n      \u003ctextlabel \n        Size={UDim2.fromOffset(200, 50)} \n        Text={coins.map((value) =\u003e `${value}`)} \n      /\u003e\n    )\n}\n```\n\n# 💡 Credits\n\nThis software uses the following:\n\n-   Emojis were taken from [here](https://emojipedia.org/)\n\n[downloads-shield]: https://img.shields.io/npm/d18m/%40rbxts%2Freact-crate?style=for-the-badge\n[downloads-url]: https://www.npmjs.com/package/@rbxts/react-crate\n[contributors-shield]: https://img.shields.io/github/contributors/neohertz/react-crate?style=for-the-badge\n[contributors-url]: https://github.com/Neohertz/react-crate/graphs/contributors\n[stars-shield]: https://img.shields.io/github/stars/neohertz/react-crate?style=for-the-badge\n[stars-url]: https://github.com/Neohertz/react-crate/stargazers\n[issues-shield]: https://img.shields.io/github/issues/neohertz/react-crate?style=for-the-badge\n[issues-url]: https://github.com/Neohertz/react-crate/issues\n[license-shield]: https://img.shields.io/github/license/neohertz/react-crate?style=for-the-badge\n[license-url]: https://github.com/Neohertz/react-crate/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNeohertz%2Freact-crate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNeohertz%2Freact-crate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNeohertz%2Freact-crate/lists"}