-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Allow multiple stateless components in a single file #575
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
Conversation
👍 |
This relates to #612. What is your rationale for not putting each component in its own module? |
Mostly it's because the stateless functions makes it really easy to have lots of really tiny components, that might not be reusable. Having them in their own files seems overkill when they are only used in a single place. As we use CSS Modules as well, that'd mean an extra stylus file in addition, for something that might be 3 lines of code. |
That seems reasonable to me. Let's get some more consensus (which might take a week or so, due to holidays) before proceeding. |
👍 but we don't use stateless components yet so 😐 |
Sounds like this is OK to merge, it just won't do us any good at Airbnb just yet :-) @SimenB can you rebase this freshly on top of latest master, and also add a note to this effect in the react styleguide? |
Will do later today! |
@ljharb Updated. I don't know what text you actually want though. Is this fine? |
This looks great! perhaps a link inline to the eslint rule docs? |
Like so? |
[eslint config] [minor] Allow multiple stateless components in a single file
IDK if you want it, but we had linting errors after upgrading eslint-plugin-react.
This change allows multiple stateless components in a single file.
Requires 3.80 of eslint-plugin-react
https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#380---2015-11-07