I created new react native project as per client requirement.I have knowledge and yet not any project done so please give me any project structure how to build this project.
Or give me any git hub link
Thanks
How to Structure React Project? We have read many articles where each article explains the boilerplate, and we might get confused about which one is the best approach. There is no "best project architecture" that will fit with any project and coding style. But you should always structure your project.
Option 1: Using React-Native-Rename After that you should proceed as with any javascript project: Go to your project's root folder and run npm install . If you are using Xcode 12.5 or higher got to /ios and execute pod install -- repo-update` Run npm run ios or npm run android to start your application!
In your scenario, you can make your own folder structure or I have some example which I follow by myself.
Separating by type means that we organise files by their type. If it is a component, there are container and presentational files. If it is Redux, there are action, reducer, and store files. If it is view, there are JavaScript, HTML, and CSS files.
src
app
api
assets
redux
actions
reducers
store
components
containers
navigation
styles
utilities
All the files are inside this base component.
This folder contains logic related to external API communications, it includes:
constants.js - where all required static values are stored.
helper.js - for storing reusable logic.
individual feature files — Each feature file contains api communication logic for a particular feature.
Just as the name implies, this houses static files (e.g images) used in the application.
This holds all the redux files if you are using react-redux for managing state. Inside redux folder you have actions, reducers, store which can easily manage your redux files
All the action files which are using around redux goes here.
All the reducers which are using around redux goes here.
You can put your store inside this redux store folder.
Shared components used across features are placed in this directory. An example of such (as shown above) is the layout
component, which is used to wrap the application components and determine its overall layout.
You can put you all screen-based components inside here (Eg - SplashScreen, HomeScreen).
You project base navigation goes here. You can create stack navigator and export it to your application.
If you have global styles defined in your project you can put it over here like colors, font styles like things.
You can put utils files over here.
Refere these links also
https://medium.com/the-andela-way/how-to-structure-a-react-native-app-for-scale-a29194cd33fc
https://www.freecodecamp.org/news/how-to-structure-your-project-and-manage-static-resources-in-react-native-6f4cfc947d92/
https://github.com/asimolmez/react-native-folder-structure
https://github.com/thecodingmachine/react-native-boilerplate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With