-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 does every component require a package.json? #3
Comments
I could be totally mistaken, but my guess would be to avoid versioning control issues. Any dependency changes for a component might break other components, so giving each component its own separate package.json makes it much easier to manage. |
Each component has a package.json for convenience. The import statement for the component only has to specify the directory instead of the directory and the component file. So instead of this in Full.js: You can do this: The package.json file includes a Without the package.json, one would would either name the component file |
Pardon me, I've come to this thread to ask a question regarding this particular way of structuring and importing components. When I try and structure my components with a separate However, when I replace the component file name within its folder as Any idea why this happens and what I can do to avoid using multiple Thanks in advance! |
I am also interested why it is happening |
Package.json files have been removed in v3 version of the template |
Hello!
Thank you for all your work with this project. I am trying to understand it more thoroughly. Why does every React component require it's own folder and package.json?
The text was updated successfully, but these errors were encountered: