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

Component files named index.jsx #74

Closed
nicgordon opened this issue Feb 27, 2016 · 2 comments
Closed

Component files named index.jsx #74

nicgordon opened this issue Feb 27, 2016 · 2 comments

Comments

@nicgordon
Copy link

Just a thought I had that I wanted to put up for discussion:
Currently, to import a component from another file you have to do something like './container/PostContainer/PostContainer'; and the second PostContainer seems a bit redundant. Inside our component and container folders we have the component itself named index.jsx. This is so that we are able to simply import that file from around the application by going import PostContainer from './container/PostContainer'; which reads much nicer.

@carloscuatin
Copy link
Contributor

It is something interesting but always complicates things because if we leave a index.js will detect complex in editors when searching the file for editing and remove the folders is not a good idea because what is sought is to separate each container your css or configuration files needed without seeing scattered in the container folder

@somus
Copy link
Contributor

somus commented May 26, 2016

As @carloscuatin expressed, it can become difficult with IDEs if we name those files index.jsx. Both ways has their advantages and disadvantages. We can continue the discussion at #90.

@somus somus closed this as completed May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants