Skip to content

Commit de865fc

Browse files
author
Sven
committed
Refactor:comments  
1 parent 9b03d8c commit de865fc

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/components/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Provider } from 'react-redux'
44
import PropTypes from 'prop-types'
55

66
class 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 (

src/layouts/PageLayout/PageLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const location = {
1212
}
1313
}
1414
export default class PageLayout extends React.Component {
15-
// 类的静态属性,不会被实例继承
15+
/* 类的静态属性,不会被实例继承。ES试验特性写法:propTypes写入class */
1616
static propTypes = {
1717
children : PropTypes.node
1818
}

src/routes/Counter/components/Counter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import PropTypes from 'prop-types'
33
import { Button } from 'reactstrap'
44

5+
// Stateless Functional Component
56
export const Counter = ({ counter, increment, doubleAsync }) => (
67
<div style={{ margin : '0 auto' }}>
78
<h3>Counter: {counter}</h3>

0 commit comments

Comments
 (0)