If you are wondering how to structure a React project, this is a question that you aren’t the only one trying to answer that question. From my experience with React, you have to answer 3 questions first:
- Is your project small, medium, or large?
- Is this a personal project or a company project?
- Are you going to have multiple apps built using React?
Why does project size matter? This matters because if it’s a small personal project, do whatever makes sense to you.
Small to Medium Personal Projects
src/ - Components/ (for reuable components) - Utils/ (Such as Ajax, URI manipulation, etc) - Views/ (Such as header, footer, feed item)
Large Company Projects
src/ - Components/ (for git submodules so these could be maintained differently) - News Feed/ (example git submodule) - Advertisements/ (example git submodule) - Utils/ (Have this be a submodule) - Views/ - Page1/ - _page1OnlyItems/ - page1.css - page1.test.js
If you have any questions, I can adjust this post to accommodate for other types of structures that you have found successful.