Browse Source

Nitpick: use FB style in doc

main
Dan Abramov 8 years ago
parent
commit
a1f22dd855
  1. 6
      docs/react-without-es6.md

6
docs/react-without-es6.md

@ -97,7 +97,7 @@ In React components declared as ES6 classes, methods follow the same semantics a
class SayHello extends React.Component {
constructor(props) {
super(props);
this.state = { message: 'Hello!' };
this.state = {message: 'Hello!'};
// This line is important!
this.handleClick = this.handleClick.bind(this);
}
@ -122,7 +122,7 @@ With `React.createClass()`, this is not necessary because it binds all methods:
```javascript
var SayHello = React.createClass({
getInitialState: function() {
return { message: 'Hello!' };
return {message: 'Hello!'};
},
handleClick: function() {
@ -148,7 +148,7 @@ If the boilerplate code is too unattractive to you, you may enable the **experim
class SayHello extends React.Component {
constructor(props) {
super(props);
this.state = { message: 'Hello!' };
this.state = {message: 'Hello!'};
}
// WARNING: this syntax is experimental!
// Using an arrow here binds the method:

Loading…
Cancel
Save