Browse Source

Use ES6 in Language Tooling doc

main
ankitml 9 years ago
committed by Dan Abramov
parent
commit
4f2168e0d5
  1. 29
      docs/09.1-language-tooling.md

29
docs/09.1-language-tooling.md

@ -37,28 +37,23 @@ Example output:
```
$ cat test.js
var HelloMessage = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
function HelloMessage(props) {
return <div>Hello {props.name}</div>;
}
ReactDOM.render(<HelloMessage name="John" />, mountNode);
$ babel test.js
"use strict";
var HelloMessage = React.createClass({
displayName: "HelloMessage",
render: function render() {
return React.createElement(
"div",
null,
"Hello ",
this.props.name
);
}
});
function HelloMessage(props) {
return React.createElement(
"div",
null,
"Hello ",
props.name
);
}
ReactDOM.render(React.createElement(HelloMessage, { name: "John" }), mountNode);
```

Loading…
Cancel
Save