-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Stance on React 0.14 stateless function components #612
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
Comments
We don't use React 0.14 just quite yet so we don't have a stance on it. If you're just looking for opinions then I believe that stateless function components should make up a vast majority of your components therefore I'd use those over |
I agree with @goatslacker - stateless functional components are fantastic, and once we upgrade to 0.14 we'll upgrade our styleguide to extol their virtues. |
Maybe the linter could even suggest to use a stateless functional component if no lifecycle methods or component state is used? |
Can't we close this? Is there more work that needs to be done here? @jacobrask that seems like a feature request for eslint-react |
I think #575 clarifies our stance. I filed jsx-eslint/eslint-plugin-react#405 for that feature request. We'll also need jsx-eslint/eslint-plugin-react#357 and jsx-eslint/eslint-plugin-react#354. |
Linking to jsx-eslint/eslint-plugin-react#214 instead of jsx-eslint/eslint-plugin-react#405 |
The React part of the coding standard, with its insistence of using classes for components, when read literally seems to be prohibiting the now officially recommended stateless function components:
https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html
I guess this was just written before React 0.14. Any chances of taking some more explicit stance on those in the coding standard?
The text was updated successfully, but these errors were encountered: