Repository: mocheng/react-practice
Branch: master
Commit: 67df773606e5
Files: 269
Total size: 2.3 MB
Directory structure:
gitextract_0teq06va/
├── LICENSE
├── README.md
├── basic_stop_watch/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── ControlButtons.js
│ ├── MajorClock.js
│ ├── SplitTimes.js
│ ├── StopWatch.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── compound_component/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Tabs.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── container_component/
│ ├── .gitignore
│ ├── ;
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Joke.js
│ ├── MajorClock.js
│ ├── RandomJoke.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── counter/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Counter.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── hoc_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── HocDemo.js
│ ├── index.css
│ ├── index.js
│ ├── registerServiceWorker.js
│ ├── withLoadIndicator.js
│ └── withLogin.js
├── hooks_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Counter.js
│ ├── CounterReducer.js
│ ├── ThemeContext.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── mobx_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── config/
│ │ ├── env.js
│ │ ├── jest/
│ │ │ ├── cssTransform.js
│ │ │ └── fileTransform.js
│ │ ├── paths.js
│ │ ├── polyfills.js
│ │ ├── webpack.config.dev.js
│ │ ├── webpack.config.prod.js
│ │ └── webpackDevServer.config.js
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ ├── scripts/
│ │ ├── build.js
│ │ ├── start.js
│ │ └── test.js
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Counter.js
│ ├── CounterActions.js
│ ├── CounterDecorator.js
│ ├── CounterStore.js
│ ├── CounterStoreDecorate.js
│ ├── CounterView.js
│ ├── ModeSwitch.js
│ ├── index.css
│ ├── index.js
│ ├── playground.js
│ └── registerServiceWorker.js
├── next_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── components/
│ │ ├── head.js
│ │ └── nav.js
│ ├── next.config.js
│ ├── package.json
│ └── pages/
│ └── index.js
├── profiler_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── ControlButtons.js
│ ├── MajorClock.js
│ ├── SplitTimes.js
│ ├── StopWatch.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── provider_pattern/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── ContextDemo.js
│ ├── ProviderDemo.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── react_router_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── About.js
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Content.js
│ ├── Home.js
│ ├── Navigation.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── redux_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Counter.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── render_props_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── Auth.js
│ ├── Login.js
│ ├── RenderAll.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── styled_stop_watch/
│ ├── .gitignore
│ ├── README.md
│ ├── config-overrides.js
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── ControlButtons.css
│ ├── ControlButtons.js
│ ├── ControlButtons.test.js
│ ├── MajorClock.js
│ ├── SplitTimes.js
│ ├── StopWatch.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── suspense_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── SuspenseDemo.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
├── suspense_polyfill_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── SuspenseDemo.js
│ ├── future.js
│ ├── index.css
│ ├── index.js
│ ├── registerServiceWorker.js
│ └── suspense.js
├── tdd_demo/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ └── serviceWorker.js
├── template/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ └── registerServiceWorker.js
└── unstated_demo/
├── .gitignore
├── README.md
├── package.json
├── public/
│ ├── index.html
│ └── manifest.json
└── src/
├── App.css
├── App.js
├── App.test.js
├── Counter.js
├── CounterContainer.js
├── index.css
├── index.js
└── registerServiceWorker.js
================================================
FILE CONTENTS
================================================
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Morgan Cheng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# react-practice
《React实战:设计模式和最佳实践》源代码
# 介绍
这个repo里的代码是掘金小册《[React实战:设计模式和最佳实践](https://juejin.im/book/5ba42844f265da0a8a6aa5e9)》配套的源代码,欢迎订阅我的[掘金小册](https://juejin.im/book/5ba42844f265da0a8a6aa5e9),也欢迎在掘金上[关注我](https://juejin.im/user/5b69aceaf265da0faa368ffa)。
如果有什么问题,可以直接在[知乎](https://www.zhihu.com/people/morgancheng/activities)给我私信。
此外,我还有一个知识星球《[进击的React](https://t.zsxq.com/ey7MrBe)》,每个工作日都会发表React最新资讯,欢迎加入。
================================================
FILE: basic_stop_watch/.gitignore
================================================
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
================================================
FILE: basic_stop_watch/README.md
================================================
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
Below you will find some information on how to perform common tasks.
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).
## Table of Contents
- [Updating to New Releases](#updating-to-new-releases)
- [Sending Feedback](#sending-feedback)
- [Folder Structure](#folder-structure)
- [Available Scripts](#available-scripts)
- [npm start](#npm-start)
- [npm test](#npm-test)
- [npm run build](#npm-run-build)
- [npm run eject](#npm-run-eject)
- [Supported Browsers](#supported-browsers)
- [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)
- [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)
- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
- [Debugging in the Editor](#debugging-in-the-editor)
- [Formatting Code Automatically](#formatting-code-automatically)
- [Changing the Page `