Skip to content
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

Merged
merged 3 commits into from
Jan 21, 2016
Merged

Favor stateless functions over classes when there's no state #688

merged 3 commits into from
Jan 21, 2016

Conversation

joaomilho
Copy link
Contributor

No description provided.

}

// good
function Listing({ hello }){
Copy link
Collaborator

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 {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solved.

@ljharb ljharb changed the title Favour stateless functions over classes when there's no state Favor stateless functions over classes when there's no state Jan 20, 2016
@ljharb
Copy link
Collaborator

ljharb commented Jan 20, 2016

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.

@@ -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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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;
@joaomilho
Copy link
Contributor Author

It's all fixed.

ljharb added a commit that referenced this pull request Jan 21, 2016
[guide] Favor stateless functions over classes when there's no state
@ljharb ljharb merged commit 06746fa into airbnb:master Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants