File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed
routes/Counter/components Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import { Provider } from 'react-redux'
44import PropTypes from 'prop-types'
55
66class App extends React . Component {
7- // ES试验特性写法
87 static propTypes = {
98 store : PropTypes . object . isRequired ,
109 routes : PropTypes . object . isRequired
@@ -15,6 +14,7 @@ class App extends React.Component {
1514 }
1615
1716 render ( ) {
17+ /* ES6 解构赋值 */
1818 const { store, routes } = this . props
1919
2020 return (
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const location = {
1212 }
1313}
1414export default class PageLayout extends React . Component {
15- // 类的静态属性,不会被实例继承
15+ /* 类的静态属性,不会被实例继承。ES试验特性写法:propTypes写入class */
1616 static propTypes = {
1717 children : PropTypes . node
1818 }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react'
22import PropTypes from 'prop-types'
33import { Button } from 'reactstrap'
44
5+ // Stateless Functional Component
56export const Counter = ( { counter, increment, doubleAsync } ) => (
67 < div style = { { margin : '0 auto' } } >
78 < h3 > Counter: { counter } </ h3 >
You can’t perform that action at this time.
0 commit comments