Skip to content

Commit 4d2578c

Browse files
author
Juan Lulkin
committed
Fix PR comments
- Space between function name and args; - use `render(){}` syntax in object literal; - Fix link to section;
1 parent a568c7c commit 4d2578c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

react/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- Always use JSX syntax.
2626
- Do not use `React.createElement` unless you're initializing the app from a file that is not JSX.
2727

28-
## Class vs `React.createClass`
28+
## Class vs `React.createClass` vs stateless
2929

3030
- 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.
3131

@@ -35,7 +35,7 @@
3535
// bad
3636
const Listing = React.createClass({
3737
// ...
38-
render: function() {
38+
render() {
3939
return <div>{this.state.hello}</div>;
4040
}
4141
});
@@ -61,7 +61,7 @@
6161
}
6262
6363
// good
64-
function Listing ({ hello }) {
64+
function Listing({ hello }) {
6565
return <div>{hello}</div>;
6666
}
6767
```

0 commit comments

Comments
 (0)