{"id":30946426,"url":"https://github.com/denis-peshkov/react-ts-mobx-app","last_synced_at":"2026-05-16T18:02:41.609Z","repository":{"id":205173700,"uuid":"131114809","full_name":"denis-peshkov/react-ts-mobx-app","owner":"denis-peshkov","description":"How to create a React + TypeScript +MobX","archived":false,"fork":false,"pushed_at":"2018-05-07T09:14:29.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-24T19:51:42.887Z","etag":null,"topics":["example","example-project","mobx","mobx-react","react","ts","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denis-peshkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-04-26T07:10:12.000Z","updated_at":"2019-03-06T11:39:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"081d93b0-899f-4908-ac0e-24ce05df9bca","html_url":"https://github.com/denis-peshkov/react-ts-mobx-app","commit_stats":null,"previous_names":["denis-peshkov/react-ts-mobx-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/denis-peshkov/react-ts-mobx-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denis-peshkov%2Freact-ts-mobx-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denis-peshkov%2Freact-ts-mobx-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denis-peshkov%2Freact-ts-mobx-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denis-peshkov%2Freact-ts-mobx-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denis-peshkov","download_url":"https://codeload.github.com/denis-peshkov/react-ts-mobx-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denis-peshkov%2Freact-ts-mobx-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274556554,"owners_count":25307506,"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-09-10T02:00:12.551Z","response_time":83,"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":["example","example-project","mobx","mobx-react","react","ts","typescript"],"created_at":"2025-09-11T00:49:26.228Z","updated_at":"2026-05-16T18:02:41.520Z","avatar_url":"https://github.com/denis-peshkov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-ts-mobx-app\nHow to create a React + TypeScript + MobX?\u003cbr\u003e\nThis quick start guide will teach you how to wire up TypeScript with [React](http://facebook.github.io/react/).\nBy the end, you'll have\n\n* a project with React and TypeScript\n* linting with [TSLint](https://github.com/palantir/tslint)\n* testing with [Jest](https://facebook.github.io/jest/) and [Enzyme](http://airbnb.io/enzyme/), and\n* state management with [MobX](https://mobx.js.org/)\n\n## Table of Contents\n\n- [Create project with TS](#create-project-with-ts)\n  - [install create-react-app](#install-create-react-app)\n  - [fix tsconfig.json](#fix-tsconfigjson)\n  - [update .gitignore](#update-gitignore)\n  - [yarn build](#yarn-build)\n- [Add MobX](#add-mobx)\n  - [add react-app-rewired](#add-react-app-rewired)\n  - [add config-overrides.js](#add-config-overridesjs)\n  - [update package.json](#update-packagejson)\n\n## Create project with TS\n\n### install create-react-app\n```bash\n$ npm install -g create-react-app\n```\n\n### create a project\n```shell\n$ create-react-app my-app --scripts-version=react-scripts-ts\n$ cd my-app/\n```\n\n### fix tsconfig.json\nThere is a problem with just created project, can't build it with `yarn build` command. Fix of the problem:\n```diff\n  \"compilerOptions\": {\n+    \"baseUrl\": \"http://localhost\",\n    \"outDir\": \"build/dist\",\n```\n\n### update .gitignore\nAdd some rules for VS Code. Also exclude css files from the repository, it should build authomatically.\n```diff\n-npm-debug.log*\n+# css\n+*.css\n+\n+# yarn\n+yarn.lock\n+# npm\n+package-lock.json\n+npm-debug.log*\n+\n+.vscode/*\n+!.vscode/settings.json\n+!.vscode/tasks.json\n+!.vscode/launch.json\n+!.vscode/extensions.json\n```\n\n### `yarn build`\n\nBuilds the app for production to the `build` folder.\u003cbr\u003e\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\u003cbr\u003e\nYour app is ready to be deployed!\n\n[Top](#top)\n\n## Add MobX\n\n### add react-app-rewired\n```bash\n$ yarn add react-app-rewired react-app-rewire-mobx -D\n$ yarn add mobx mobx-react mobx-react-router\n```\n\n### add config-overrides.js\n```\nconst { injectBabelPlugin } = require('react-app-rewired');\nconst rewireMobX = require('react-app-rewire-mobx');\n\nmodule.exports = function override(config, env) {\n  // add a plugin\n  config = injectBabelPlugin('babel-plugin-styled-components', config);\n\n  // use the MobX rewire\n  config = rewireMobX(config, env);\n\n  return config\n}\n```\n\n### update package.json\nReplace standard commands with react-app-rewired commands.\n```diff\n  \"scripts\": {\n-   \"start\": \"react-scripts-ts start\",\n-   \"build\": \"react-scripts-ts build\",\n+   \"start\": \"BROWSER=none react-app-rewired start --scripts-version react-scripts-ts\",\n+   \"build\": \"react-app-rewired build --scripts-version react-scripts-ts\",\n  }\n```\n\n[Top](#top)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenis-peshkov%2Freact-ts-mobx-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenis-peshkov%2Freact-ts-mobx-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenis-peshkov%2Freact-ts-mobx-app/lists"}