Homecare Nyeri Kanker
# React Native Typescript Starter
> Specification
* typescript
* react-navigation
* test jest with typescript
* localization
* mobx
* data models
# Gain points
```
1. Typescript support. No need to run tsc because webpack is doing it for you with ts-loader.
2. Sample of mobx and data modeling.
3. Able to learn how to structure react app with typescript and mobx.
4. Test with jest-ts.
5. Learn how to localize your project.
```
# INSTALL
```
1. npm install
2. npm start
```
# Structures
```text
app/
├─ .doobooo // necessary if using dooboo-cli
├─ assets
│ └─ icons // app icons
│ └─ images // app images like background images
├─ node_modules/
├─ src/
│ └─ apis
│ └─ components
│ └─ models
│ └─ stores
│ └─ utils
│ └─ index.tsx
├─ test/
├─ .babelrc
├─ .buckconfig
├─ .flowconfig
├─ .gitattributes
├─ .gitignore
├─ .watchmanconfig
├─ app.json
├─ index.js
├─ package.json
├─ README.md
├─ rn-cli.config.js
├─ STRINGS.js
├─ tsconfig.json
└─ tslint.json
```
# Running the project
Running the project is as simple as running
```sh
npm run start
```
This runs the `start` script specified in our `package.json`, and will spawn off a server which reloads the page as we save our files.
Typically the server runs at `
localhost`, but should be automatically opened for you.
## Troubleshoot
* Facing `Can't find variable Symbol` error in `window` or `ubuntu`.
```
npm install --save mobx@3.6.2
npm install --save mobx-react@4.4.3
```
## Testing the project
Testing is also just a command away:
```sh
npm test
```
> Result
```
> jest -u
PASS src/components/shared/__tests__/Button.test.tsx
PASS src/components/screen/__tests__/Intro.test.tsx
› 2 snapshots written.
Snapshot Summary
› 2 snapshots written in 1 test suite.
Test Suites: 2 passed, 2 total
Tests: 5 passed, 5 total
Snapshots: 2 added, 4 passed, 6 total
Time: 3.055s, estimated 6s
Ran all test suites
```
## Writing tests with Jest
We've created test examples with jest-ts in `src/components/screen/_ …