Browse Source

Use const instead of var (ES6 best practices)

main
Rajat Sehgal 9 years ago
parent
commit
8a03d1988d
  1. 2
      docs/05-reusable-components.it-IT.md
  2. 2
      docs/05-reusable-components.ko-KR.md
  3. 2
      docs/05-reusable-components.md
  4. 2
      docs/05-reusable-components.zh-CN.md

2
docs/05-reusable-components.it-IT.md

@ -249,7 +249,7 @@ ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
Oppure usando la nuova sintassi freccia di ES6:
```javascript
var HelloMessage = (props) => <div>Ciao {props.name}</div>;
const HelloMessage = (props) => <div>Ciao {props.name}</div>;
ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
```

2
docs/05-reusable-components.ko-KR.md

@ -244,7 +244,7 @@ ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
아니면 ES6의 화살표 문법을 사용할 수 있습니다.
```javascript
var HelloMessage = (props) => <div>Hello {props.name}</div>;
const HelloMessage = (props) => <div>Hello {props.name}</div>;
ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
```

2
docs/05-reusable-components.md

@ -243,7 +243,7 @@ ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
Or using the new ES6 arrow syntax:
```javascript
var HelloMessage = (props) => <div>Hello {props.name}</div>;
const HelloMessage = (props) => <div>Hello {props.name}</div>;
ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
```

2
docs/05-reusable-components.zh-CN.md

@ -243,7 +243,7 @@ ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
或者使用新的ES6箭头函数:
```javascript
var HelloMessage = (props) => <div>Hello {props.name}</div>;
const HelloMessage = (props) => <div>Hello {props.name}</div>;
ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
```

Loading…
Cancel
Save