{"id":15785709,"url":"https://github.com/js2me/react-stonex","last_synced_at":"2026-04-17T19:01:22.945Z","repository":{"id":144053481,"uuid":"176875504","full_name":"js2me/react-stonex","owner":"js2me","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-16T06:26:56.000Z","size":305,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-05T20:41:13.557Z","etag":null,"topics":["javascript","react","state-management","typescript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/js2me.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-03-21T05:23:07.000Z","updated_at":"2021-04-08T20:42:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"dda8c2a3-4f7a-49e6-a8bb-d288197c1843","html_url":"https://github.com/js2me/react-stonex","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/js2me/react-stonex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Freact-stonex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Freact-stonex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Freact-stonex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Freact-stonex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js2me","download_url":"https://codeload.github.com/js2me/react-stonex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Freact-stonex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31941845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["javascript","react","state-management","typescript"],"created_at":"2024-10-04T20:41:12.717Z","updated_at":"2026-04-17T19:01:22.927Z","avatar_url":"https://github.com/js2me.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReactJS + Stonex\nReactJS integration with Stonex\n\n\n## How to use  \nBefore at all need to install `react-stonex` (`yarn add react-stonex` or `npm i -S react-stonex`)  \nThis library have dependencies (it should be installed in your project)  \n```\n    \"react\": \"^16.4.2\",\n    \"react-dom\": \"^16.4.2\",\n    \"stonex\": \"^0.1.0-alpha\"\n```\n\nIn your React Stonex application:  \n\n1. Add `ReactStonexModifier` to your stonex  \n\n```\nimport { StonexStore } from 'stonex'\nimport { ReactStonexModifier } from 'react-stonex'\n\nconst store = new StonexStore(\n  {\n    // your modules\n  },\n  {\n    modifiers: [ReactStonexModifier],\n  }\n)\n```\n\n2. Add to the root of the React render tree the `Provider` component and send `store` to him props  \n\n```\nimport store from 'path-to-your-store'\nimport { Provider } from 'react-stonex'\n\n\nconst Root = () =\u003e {\n  return (\n    \u003cProvider store={store}\u003e\n        // your react tree\n    \u003c/Provider\u003e\n  )\n}\n```\n\n3. Attach some components which you need to link with `Stonex` store using the `connect()` function  \n\n```\nimport { connect } from 'react-stonex'\n\n\nconst mapStoreToProps = (state, modules, ownProps) =\u003e {\n\n    return {\n        fruit: state.fruits.actualFruit,\n        createFruit: modules.fruits.createFruit,\n        // ownProps is not required to return\n        // because props of your cool component\n        // already will contains in component's instance\n    }\n}\n\nconst WrappedCoolComponent = connect(mapStoreToProps)(YourCoolComponent)\n\n\n// somewhere in react tree\n\u003cWrappedCoolComponent\u003e\u003c/WrappedCoolComponent\u003e\n\n\n```\n\nThat's all what you need to do to link your Stonex store with React :) Enjoy!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs2me%2Freact-stonex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs2me%2Freact-stonex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs2me%2Freact-stonex/lists"}