-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
prefer-stateless-function documentation is wrong #588
Comments
I have the same issue
eslint.rc:
The file in question:
|
These are not false positives. A class-based component that has nothing but a render method should be an SFC instead. |
Ah true, I see. Should have looked more closely at the explanation |
@MichalZalecki i'm going to close this, but will be happy to reopen if further clarification is needed |
@ljharb According to this doc, yes https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md Look at "The following patterns are not considered warnings:". 2. example is failing on that rule. |
Hmm, you're right. I think the documentation is wrong then. |
@MichalZalecki ah, i think i get the difference - in React 15, SFCs can return null. So, that example should only not be a warning in React 0.13 or 0.14. |
Hi!
I'm facing false positive for rule
prefer-stateless-function
with latest dependencies.The text was updated successfully, but these errors were encountered: