From 3071ad08f5bb617079dce6d4ea1dd677f5ab4409 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Fri, 21 Oct 2016 14:30:35 -0700 Subject: [PATCH] Update react-without-jsx.md Facebook codestyle --- docs/react-without-jsx.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/react-without-jsx.md b/docs/react-without-jsx.md index bcb8c8fd8..bf503e64f 100644 --- a/docs/react-without-jsx.md +++ b/docs/react-without-jsx.md @@ -32,8 +32,10 @@ class Hello extends React.Component { } } -ReactDOM.render(React.createElement(Hello, {toWhat: 'World'}, null), - document.getElementById('root')); +ReactDOM.render( + React.createElement(Hello, {toWhat: 'World'}, null), + document.getElementById('root') +); ``` If you're curious to see more examples of how JSX is converted to JavaScript, you can try out [the online Babel compiler](https://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015%2Creact%2Cstage-0&code=function%20hello()%20%7B%0A%20%20return%20%3Cdiv%3EHello%20world!%3C%2Fdiv%3E%3B%0A%7D). @@ -45,8 +47,10 @@ If you get tired of typing `React.createElement` so much, one common pattern is ```js var e = React.createElement; -ReactDOM.render(e('div', null, 'Hello World'), - document.getElementById('root')); +ReactDOM.render( + e('div', null, 'Hello World'), + document.getElementById('root') +); ``` If you use this shorthand form for `React.createElement`, it can be almost as convenient to use React without JSX.