{"id":20990226,"url":"https://github.com/shanamaid/react-use-mobx","last_synced_at":"2026-03-03T19:03:36.715Z","repository":{"id":57347136,"uuid":"204635301","full_name":"ShanaMaid/react-use-mobx","owner":"ShanaMaid","description":"React hook for MobX and Mobx React!","archived":false,"fork":false,"pushed_at":"2019-08-27T07:16:50.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T02:07:41.852Z","etag":null,"topics":["hook","hooks","mobx","mobx-hook","mobx-react","react","react-hook","react-use","reactjs","typescript","useobservable"],"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/ShanaMaid.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}},"created_at":"2019-08-27T06:30:56.000Z","updated_at":"2020-08-05T03:00:26.000Z","dependencies_parsed_at":"2022-09-18T10:51:26.981Z","dependency_job_id":null,"html_url":"https://github.com/ShanaMaid/react-use-mobx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShanaMaid%2Freact-use-mobx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShanaMaid%2Freact-use-mobx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShanaMaid%2Freact-use-mobx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShanaMaid%2Freact-use-mobx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShanaMaid","download_url":"https://codeload.github.com/ShanaMaid/react-use-mobx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225306323,"owners_count":17453574,"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":["hook","hooks","mobx","mobx-hook","mobx-react","react","react-hook","react-use","reactjs","typescript","useobservable"],"created_at":"2024-11-19T06:27:58.952Z","updated_at":"2026-03-03T19:03:31.689Z","avatar_url":"https://github.com/ShanaMaid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Use Mobx [![version](https://img.shields.io/npm/v/react-use-mobx.svg)](https://www.npmjs.com/package/react-use-mobx) [![minzipped size](https://img.shields.io/bundlephobia/minzip/react-use-mobx.svg)](https://www.npmjs.com/package/react-use-mobx) [![downloads](https://img.shields.io/npm/dt/react-use-mobx.svg)](https://www.npmjs.com/package/react-use-mobx) \n\n`useObservable` is a React Hook that help you use mobx and mobx-react.\n\n`useObservable` use help update data automatically insteadof `setState`!\n\n## Install\n\n* `npm install mobx mobx-react react-use-mobx` or\n* `yarn add mobx mobx-react react-use-mobx`\n\n## Example\n[Online Demo](https://stackblitz.com/edit/react-tupq9h)\n```javascript\nimport React, { useState } from 'react';\nimport { useObservable, observer } from 'react-use-mobx';\nimport { render } from 'react-dom';\n\nconst App = observer(() =\u003e {\n  const [ count1, setCount ] = useState({a: 1});\n  /**\n   * initialState must be Object!!!!!!\n   */\n  const count2 = useObservable({a: 1});\n  return (\n    \u003cdiv\u003e\n    \u003ch2\u003euseState\u003c/h2\u003e\n    \u003cbutton onClick={() =\u003e setCount({a: count1.a + 1})}\u003ecount: {count1.a}\u003c/button\u003e\n    \u003ch2\u003ereact-use-mobx\u003c/h2\u003e\n    \u003cbutton onClick={() =\u003e count2.a++}\u003ecount: {count2.a}\u003c/button\u003e\n    \u003c/div\u003e\n  );\n});\n\nrender(\u003cApp /\u003e, document.getElementById('root'));\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanamaid%2Freact-use-mobx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshanamaid%2Freact-use-mobx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanamaid%2Freact-use-mobx/lists"}