From 4d2578cc83affc21fbddfa3c7753b0c05e0205fb Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Wed, 20 Jan 2016 22:36:11 +0200 Subject: [PATCH] Fix PR comments - Space between function name and args; - use `render(){}` syntax in object literal; - Fix link to section; --- react/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react/README.md b/react/README.md index 7cc49931..e5511729 100644 --- a/react/README.md +++ b/react/README.md @@ -25,7 +25,7 @@ - Always use JSX syntax. - Do not use `React.createElement` unless you're initializing the app from a file that is not JSX. -## Class vs `React.createClass` +## Class vs `React.createClass` vs stateless - If you have internal state and/or refs, prefer `class extends React.Component` over `React.createClass` unless you have a very good reason to use mixins. @@ -35,7 +35,7 @@ // bad const Listing = React.createClass({ // ... - render: function() { + render() { return
{this.state.hello}
; } }); @@ -61,7 +61,7 @@ } // good - function Listing ({ hello }) { + function Listing({ hello }) { return
{hello}
; } ```