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

Why is react/prefer-stateless-function disabled? #1070

Closed
amilajack opened this issue Oct 3, 2016 · 5 comments
Closed

Why is react/prefer-stateless-function disabled? #1070

amilajack opened this issue Oct 3, 2016 · 5 comments

Comments

@amilajack
Copy link
Member

In many places, it seems like the eslint rule react/prefer-stateless-function is disabled. What was the reasoning for this decision? Personally, I think stateless components is one of the best parts of react because it emphasizes how the UI is a pure function of the state.

@gihrig
Copy link
Contributor

gihrig commented Oct 3, 2016

There is an issue with HMR working only with class based components. e.g. #590, #684 and #821.

@amilajack
Copy link
Member Author

amilajack commented Oct 3, 2016

I see. Thanks for clarifying.

@sedubois
Copy link
Contributor

sedubois commented Oct 4, 2016

Shouldn't react/prefer-stateless-function be disabled in package.json?

@gihrig
Copy link
Contributor

gihrig commented Oct 4, 2016

There's an update coming (don't recall which package) that's expected to fix this issue. Disabling in package.json might lead to forgetting about it, but an open issue is probably a better reminder.

ref: react-ho-boilerplate (comment)

@lock
Copy link

lock bot commented May 30, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 30, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants