-
Notifications
You must be signed in to change notification settings - Fork 8
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
React Native - Project Structure #137
Comments
Aspects which spring to mind immediately:
|
Since I've been doing a ton of React Native work I've come up with my own structure that all of my applications tend to follow. It works well. Overview:Excludes:
Exclude the File/Directory names:File/Directory names should always be lowercase and hyphenated.
Structure:
Components:
When structuring components I tend to have a base class (such as import Card from '../components/card'
import JobCard from '../components/card/job' There's much more to be discussed on the contents and structure of each file. But that's for another thread. |
@dextermb All looks good, though I'm not sure why .vscode is excluded; without it, you can't configure build tasks, etc. Also: where do artefacts go? |
What do you mean by this? |
I've not worked with React Native much or for a long time, I seemed to remember it produced a build artefact, am I mistaken? |
These are stored on the Expo account whichever the build is ran on. We have a Langley Foxall Expo account, to try and centralize everything, so you'd be able to get them from there. They should definitely not be included in Git. |
Absolutely; if there's any artefacts created during development they should be excluded (can't see them listed above). |
I didn't list them above because they shouldn't be downloaded into the project directory to begin with |
As long as it doesn't create them during local development that's all good 👍 |
It would probably be worth creating a GitHub template repository for this structure that we could use as the basis for new React Native apps. I do not believe |
I've not seen anything for boiler plating; I believe that the "ng" tool used to create Angular applications is something they've made themselves. |
👍
I believe you can pass an initializer or template into |
What you would like to change/add
I'd like to standardise our project structure for RN applications, and secondarily create a boilerplate to enforce/make this easy to adhere to.
Comment with the most upvotes that contains a valid RN project structure wins.
Vote closes COB Wednesday 25th
Why you would like to change/add this
Too hard to onboard developers to projects when the structure is different every time.
Examples
Open to suggestions on this, but there are discussions to be had over where styles are kept, multiple files instead of single files for interfaces, prop definitions etc etc etc.
Probably submitting a tree/screenshot of project directory would be the easiest way.
Checklist
The text was updated successfully, but these errors were encountered: