From 4f2168e0d54e652ed685496e30d2377079b151e3 Mon Sep 17 00:00:00 2001 From: ankitml Date: Tue, 24 May 2016 02:15:16 +0530 Subject: [PATCH] Use ES6 in Language Tooling doc --- docs/09.1-language-tooling.md | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/docs/09.1-language-tooling.md b/docs/09.1-language-tooling.md index 79f24480..75c0c28c 100644 --- a/docs/09.1-language-tooling.md +++ b/docs/09.1-language-tooling.md @@ -37,28 +37,23 @@ Example output: ``` $ cat test.js -var HelloMessage = React.createClass({ - render: function() { - return
Hello {this.props.name}
; - } -}); +function HelloMessage(props) { + return
Hello {props.name}
; +} ReactDOM.render(, 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); ```