{"id":23440768,"url":"https://github.com/dabapps/react-set-props","last_synced_at":"2025-10-04T15:47:36.129Z","repository":{"id":57105376,"uuid":"107774813","full_name":"dabapps/react-set-props","owner":"dabapps","description":"Store arbitrary state in redux with a similar API to setState","archived":false,"fork":false,"pushed_at":"2018-11-30T10:51:50.000Z","size":225,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-06T11:47:12.750Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dabapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-21T11:33:00.000Z","updated_at":"2018-11-30T10:51:49.000Z","dependencies_parsed_at":"2022-08-20T20:10:41.255Z","dependency_job_id":null,"html_url":"https://github.com/dabapps/react-set-props","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Freact-set-props","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Freact-set-props/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Freact-set-props/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Freact-set-props/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dabapps","download_url":"https://codeload.github.com/dabapps/react-set-props/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248108853,"owners_count":21049213,"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-12-23T16:18:34.568Z","updated_at":"2025-10-04T15:47:31.107Z","avatar_url":"https://github.com/dabapps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-set-props\n\n[![Build Status](https://travis-ci.org/dabapps/react-set-props.svg?branch=master)](https://travis-ci.org/dabapps/react-set-props)\n\n**Store arbitrary state in redux with a similar API to setState**\n\n## Installation\n\n```shell\nnpm install @dabapps/react-set-props --save --save-exact\n```\n\n## Usage\n\n### TypeScript\n\n#### Connecting your component\n\n```tsx\nimport { withSetProps, SetPropsInterface } from '@dabapps/react-set-props';\n\ninterface ExternalProps {\n  buttonText: string;\n}\n\ninterface Props {\n  count: number;\n}\n\nconst MyComponent = ({buttonText, count, setProps}: ExternalProps \u0026 SetPropsInterface\u003cProps\u003e) =\u003e (\n  \u003cp\u003e\n    Count: {count}\n    \u003cbutton onClick={() =\u003e setProps({count: count + 1})}\u003e\n      {buttonText}\n    \u003c/button\u003e\n  \u003c/p\u003e\n);\n\nconst getInitialProps = (props: ExternalProps) =\u003e ({\n  count: 0\n});\n\nexport default withSetProps\u003cProps, ExternalProps\u003e(getInitialProps)(MyComponent);\n```\n\n#### Props reducer\n\n```tsx\nimport { setPropsReducer } from '@dabapps/react-set-props';\n\ncombineReducers({\n  setPropsReducer\n});\n```\n\n### Javascript\n\n#### Connecting your component\n\n```js\nimport { withSetProps } from '@dabapps/react-set-props';\n\nconst MyComponent = ({buttonText, count, setProps}) =\u003e (\n  \u003cp\u003e\n    Count: {count}\n    \u003cbutton onClick={() =\u003e setProps({count: count + 1})}\u003e\n      {buttonText}\n    \u003c/button\u003e\n  \u003c/p\u003e\n);\n\nconst getInitialProps = (props) =\u003e ({\n  count: 0\n});\n\nexport default withSetProps(getInitialProps)(MyComponent);\n```\n\n#### Props reducer\n\n```js\nimport { setPropsReducer } from '@dabapps/react-set-props';\n\ncombineReducers({\n  setPropsReducer\n});\n```\n\n## Code of conduct\n\nFor guidelines regarding the code of conduct when contributing to this repository please review [https://www.dabapps.com/open-source/code-of-conduct/](https://www.dabapps.com/open-source/code-of-conduct/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabapps%2Freact-set-props","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdabapps%2Freact-set-props","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabapps%2Freact-set-props/lists"}