{"id":17449771,"url":"https://github.com/guillempuche/tarant-react","last_synced_at":"2026-01-02T11:33:29.206Z","repository":{"id":178103249,"uuid":"611898572","full_name":"guillempuche/tarant-react","owner":"guillempuche","description":"React Hook for the actor model library Tarant","archived":false,"fork":false,"pushed_at":"2024-05-20T19:43:41.000Z","size":1710,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T06:43:47.109Z","etag":null,"topics":["actor-library","actor-model","actor-system","actors","effect","react","react-hooks","reactive","reactjs","state","state-management","stateful","tarant"],"latest_commit_sha":null,"homepage":"https://fg32c4-3000.csb.app/","language":"TypeScript","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/guillempuche.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":"2023-03-09T19:14:01.000Z","updated_at":"2024-05-20T19:43:44.000Z","dependencies_parsed_at":"2023-12-12T18:37:23.858Z","dependency_job_id":"1558bb2a-fe08-4362-8be3-60743aafb910","html_url":"https://github.com/guillempuche/tarant-react","commit_stats":null,"previous_names":["guillempuche/tarant-react"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillempuche%2Ftarant-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillempuche%2Ftarant-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillempuche%2Ftarant-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillempuche%2Ftarant-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guillempuche","download_url":"https://codeload.github.com/guillempuche/tarant-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551328,"owners_count":20309300,"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":["actor-library","actor-model","actor-system","actors","effect","react","react-hooks","reactive","reactjs","state","state-management","stateful","tarant"],"created_at":"2024-10-17T21:53:26.124Z","updated_at":"2026-01-02T11:33:29.167Z","avatar_url":"https://github.com/guillempuche.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tarant React Hook\n\nA React hook library designed to seamlessly integrate [Tarant](https://github.com/guillempuche/tarant), an actor model library, into React applications. This library provides hooks and utilities to manage actor lifecycle and state within React components, facilitating the development of reactive and scalable applications with the actor model pattern.\n\n## Features\n\n- **React Materializer**: A custom materializer for integrating Tarant actors with React, managing actor lifecycle and state updates.\n- **useActor Hook**: A React hook to subscribe to Tarant actor states and re-render components upon state changes.\n\n## Installation\n\nTo install `tarant-react-hook`, add it to your project using npm or yarn:\n\n```bash\nnpm install tarant-react-hook\n# or\nyarn add tarant-react-hook\n```\n\nEnsure that you have `tarant` and React 18 or higher installed in your project as they are peer dependencies of this library.\n\n## Usage\n\n### Setting up the React Materializer\n\nFirst, initialize your Tarant actor system with the `ReactMaterializer`:\n\n```typescript\nimport { ActorSystem } from 'tarant';\nimport { ReactMaterializer } from 'tarant-react-hook';\n\nconst actorSystem = ActorSystem.for(\n  ActorSystemConfigurationBuilder.define()\n    .withMaterializers([new ReactMaterializer()])\n    .done()\n)\n\nexport const myActor = actorSystem.actorOf(MyActor, {\n\targs...\n});\n```\n\n### Using the `useActor` Hook\n\nUse the `useActor` hook to manage actor states in your components:\n\n```tsx\nimport React from 'react';\nimport { useActor } from 'tarant-react-hook';\nimport { myActor } from './actors';\n\nconst MyComponent = () =\u003e {\n  const myActorState = useActor(myActor, { debug: true});\n\n  return \u003cdiv\u003e{myActorState.fieldA}\u003c/div\u003e;\n};\n```\n\n## Example\n\nFor a comprehensive example, check out the [Library of Text Quotes example](https://github.com/guillempuche/tarant-react/blob/main/examples/library_of_text_quotes/) which demonstrates how to use `tarant-react-hook` to build a simple application.\n\nTry it here on this [CodeSandbox](https://fg32c4-3000.csb.app/).\n\n![Example](example.png)\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/guillempuche/tarant-react/issues).\n\n## License\n\n`tarant-react-hook` is [MIT licensed](https://github.com/guillempuche/tarant-react/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguillempuche%2Ftarant-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguillempuche%2Ftarant-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguillempuche%2Ftarant-react/lists"}