35 | }
36 | }
37 |
38 | const mapStateToProps = (state) => {
39 | return{
40 | state
41 | }
42 |
43 |
44 | }
45 |
46 |
47 | export default connect(mapStateToProps)(App)
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## `这是一个React的组件通信的demo`
2 |
3 | ### `对于不是很了解组件通讯的同学来说这是一个福音,因为这个demo包含了所有的组件通讯的方法,相信聪明的你一定能快速上手`
4 |
5 | #### `克隆文件夹,安装依赖 使用行命令npm start 来查看这个demo`
6 |
7 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
8 |
9 | ### `你可以利用这些来做这些事情`
10 |
11 | ### `npm start`
12 |
13 | Runs the app in the development mode.
14 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
15 |
16 | The page will reload if you make edits.
17 | You will also see any lint errors in the console.
18 |
19 | ### `npm test`
20 |
21 | Launches the test runner in the interactive watch mode.
22 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
23 |
24 | ### `npm run build`
25 |
26 | #### `利用 build 来打包`
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `npm run eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 |
35 | #### 你只有一次机会可以反编译,这是无法挽回的,编译之后可以来配置config文件等等,加快学习的步伐!
36 |
37 | ## Learn More
38 |
39 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
40 |
41 | To learn React, check out the [React documentation](https://reactjs.org/).
42 |
43 | ### Code Splitting
44 |
45 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
46 |
47 | ### Analyzing the Bundle Size
48 |
49 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
50 |
51 | ### Making a Progressive Web App
52 |
53 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
54 |
55 | ### Advanced Configuration
56 |
57 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
58 |
59 | ### Deployment
60 |
61 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
62 |
63 | ### `npm run build` fails to minify
64 |
65 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
66 |
--------------------------------------------------------------------------------