-
Notifications
You must be signed in to change notification settings - Fork 26.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Favor stateless functions over classes when there's no state #688
Conversation
} | ||
|
||
// good | ||
function Listing({ hello }){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should always be a space between )
and {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved.
Thanks, this looks great pending a few comments. It would be ideal if there was a linter rule that could help enforce this, although it may not be possible. |
According to PR comments.
@@ -5,7 +5,7 @@ | |||
## Table of Contents | |||
|
|||
1. [Basic Rules](#basic-rules) | |||
1. [Class vs `React.createClass`](#class-vs-reactcreateclass) | |||
1. [Class vs `React.createClass` vs stateless](#class-vs-reactcreateclass-vs-stateless) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's unfortunate that this will break the link - however since the title on line 28 didn't change, are you sure this link works now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it works :D
- Space between function name and args; - use `render(){}` syntax in object literal; - Fix link to section;
It's all fixed. |
[guide] Favor stateless functions over classes when there's no state
No description provided.