├── .gitignore
├── README.md
├── typescript-react-app
├── .gitignore
├── README-CRA.md
├── README.md
├── images.d.ts
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
├── src
│ ├── App.css
│ ├── App.test.tsx
│ ├── App.tsx
│ ├── actions
│ │ └── index.tsx
│ ├── components
│ │ └── Counter.tsx
│ ├── constants
│ │ └── index.tsx
│ ├── container
│ │ └── CountCon.tsx
│ ├── index.css
│ ├── index.tsx
│ ├── logo.svg
│ ├── reducer
│ │ └── index.tsx
│ ├── registerServiceWorker.ts
│ └── types
│ │ └── index.tsx
├── tsconfig.json
├── tsconfig.prod.json
├── tsconfig.test.json
└── tslint.json
└── typescript-react-todos
├── .gitignore
├── README-CRA.md
├── README.md
├── images.d.ts
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
├── src
├── App.css
├── App.test.tsx
├── App.tsx
├── actions
│ └── index.tsx
├── components
│ ├── footer
│ │ └── index.tsx
│ ├── link
│ │ └── index.tsx
│ ├── todo
│ │ └── index.tsx
│ └── todoList
│ │ └── index.tsx
├── constants
│ └── index.tsx
├── container
│ ├── addTodo
│ │ └── index.tsx
│ ├── filterLink
│ │ └── index.tsx
│ └── visibleTodoList
│ │ └── index.tsx
├── index.css
├── index.tsx
├── logo.svg
├── reducers
│ ├── index.tsx
│ ├── todos.tsx
│ └── visibilityFilter.tsx
├── registerServiceWorker.ts
└── types
│ └── index.tsx
├── tsconfig.json
├── tsconfig.prod.json
├── tsconfig.test.json
└── tslint.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | */node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 | /dist
14 |
15 | # misc
16 | .DS_Store
17 | .env.local
18 | .env.development.local
19 | .env.test.local
20 | .env.production.local
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 | yarn.lock
26 | package-lock.json
27 | .vscode
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # typescript-react-example
2 | 使用 TypeScript + React + Redux 开发的相关 Demo
3 |
4 |
5 | ## 下载命令
6 | ``` bash
7 | $ git clone https://github.com/beichensky/typescript-react-example.git
8 | ```
9 |
10 |
11 |
12 | ## typescript-react-app
13 | 使用 `create-react-app` 搭建的使用 `TypeScript` 进行 `React` 开发的脚手架。其中具备 `tslint` 检测功能,并且结合了 `Redux` 进行状态管理。适合作为 `TypeScript` + `React` 开发的入门参考。
14 |
15 | ### 项目内容
16 | 根据 + 或者 - 按钮可以控制 Counter 组件中的 times 次数显示。可以用来学习 TypeScript 配合 React、Redux 的使用方式。
17 |
18 | 更多详细信息请查看:[项目说明文档](https://github.com/beichensky/typescript-react-example/blob/master/typescript-react-app/README.md)
19 |
20 |
21 |
22 |
23 | ## typescript-react-todos
24 | 使用 `create-react-app` 搭建的使用 `TypeScript` 进行 `React` 开发的脚手架。结合 `Redux` 搭建了一个 TodoList 的 Demo。大家可以下载下来,然后参照其中的组件编写规则直接进行开发。其中的各种交互以及组件稍微有点复杂,大家可以作为参考。
25 |
26 | ### 项目内容
27 | 使用 TypeScript + React + Redux 编写的一个 TodoList Demo,具备新增 Todo 事件、完成 Todo 事件、以及显示不同状态的 Todo 事件的功能。
28 |
29 | 更多详细信息请查看:[项目说明文档](https://github.com/beichensky/typescript-react-example/blob/master/typescript-react-todos/README.md)
30 |
31 |
--------------------------------------------------------------------------------
/typescript-react-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/typescript-react-app/README-CRA.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
2 |
3 | Below you will find some information on how to perform common tasks.
4 | You can find the most recent version of this guide [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).
5 |
6 | ## Table of Contents
7 |
8 | - [Updating to New Releases](#updating-to-new-releases)
9 | - [Sending Feedback](#sending-feedback)
10 | - [Folder Structure](#folder-structure)
11 | - [Available Scripts](#available-scripts)
12 | - [npm start](#npm-start)
13 | - [npm test](#npm-test)
14 | - [npm run build](#npm-run-build)
15 | - [npm run eject](#npm-run-eject)
16 | - [Supported Browsers](#supported-browsers)
17 | - [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)
18 | - [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)
19 | - [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
20 | - [Debugging in the Editor](#debugging-in-the-editor)
21 | - [Formatting Code Automatically](#formatting-code-automatically)
22 | - [Changing the Page `