Skip to content

Commit b285eb9

Browse files
authored
react-without-es6: improvements
1 parent 5666ba4 commit b285eb9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

content/docs/react-without-es6.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permalink: docs/react-without-es6.html
99
```javascript
1010
class Greeting extends React.Component {
1111
render() {
12-
return <h1>Hello, {this.props.name}</h1>;
12+
return <h1>Привет, {this.props.name}</h1>;
1313
}
1414
}
1515
```
@@ -20,7 +20,7 @@ class Greeting extends React.Component {
2020
var createReactClass = require('create-react-class');
2121
var Greeting = createReactClass({
2222
render: function() {
23-
return <h1>Hello, {this.props.name}</h1>;
23+
return <h1>Привет, {this.props.name}</h1>;
2424
}
2525
});
2626
```
@@ -37,7 +37,7 @@ class Greeting extends React.Component {
3737
}
3838

3939
Greeting.defaultProps = {
40-
name: 'Mary'
40+
name: 'Лиза'
4141
};
4242
```
4343

@@ -47,7 +47,7 @@ Greeting.defaultProps = {
4747
var Greeting = createReactClass({
4848
getDefaultProps: function() {
4949
return {
50-
name: 'Mary'
50+
name: 'Лиза'
5151
};
5252
},
5353

@@ -89,7 +89,7 @@ var Counter = createReactClass({
8989
class SayHello extends React.Component {
9090
constructor(props) {
9191
super(props);
92-
this.state = {message: 'Hello!'};
92+
this.state = {message: 'Привет!'};
9393
// Эта строка важна!
9494
this.handleClick = this.handleClick.bind(this);
9595
}
@@ -102,7 +102,7 @@ class SayHello extends React.Component {
102102
// Мы можем использовать `this.handleClick` как обработчик событий, потому что он привязан
103103
return (
104104
<button onClick={this.handleClick}>
105-
Say hello
105+
Поздороваться
106106
</button>
107107
);
108108
}
@@ -114,7 +114,7 @@ class SayHello extends React.Component {
114114
```javascript
115115
var SayHello = createReactClass({
116116
getInitialState: function() {
117-
return {message: 'Hello!'};
117+
return {message: 'Привет!'};
118118
},
119119

120120
handleClick: function() {
@@ -124,7 +124,7 @@ var SayHello = createReactClass({
124124
render: function() {
125125
return (
126126
<button onClick={this.handleClick}>
127-
Say hello
127+
Поздороваться
128128
</button>
129129
);
130130
}
@@ -139,7 +139,7 @@ var SayHello = createReactClass({
139139
class SayHello extends React.Component {
140140
constructor(props) {
141141
super(props);
142-
this.state = {message: 'Hello!'};
142+
this.state = {message: 'Привет!'};
143143
}
144144
// ВНИМАНИЕ! Этот синтаксис экспериментальный!
145145
// Здесь стрелочная функция выполняет привязку:
@@ -150,7 +150,7 @@ class SayHello extends React.Component {
150150
render() {
151151
return (
152152
<button onClick={this.handleClick}>
153-
Say hello
153+
Поздороваться
154154
</button>
155155
);
156156
}
@@ -208,7 +208,7 @@ var TickTock = createReactClass({
208208
render: function() {
209209
return (
210210
<p>
211-
React has been running for {this.state.seconds} seconds.
211+
React был выполнен за {this.state.seconds} секунд.
212212
</p>
213213
);
214214
}

0 commit comments

Comments
 (0)