Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native project/directory structure setup

Tags:

I'm learning react-native(android) on windows environment. I've manage to start a project on android(even though they only support for apple). I want some advice for naming good structures of files and folders for the project before I go deep into the code/learning. I want to organize things beforehand. Can anyone help me?

Ex. for html something like

www
 |-js
 |-css
 |-img
build
 |-js
 |-css
 |-less
...

react-native init structures have something like

android
node_modules
package.json
index.android.js
...
like image 470
MeetMahPuppy Avatar asked Nov 02 '15 11:11

MeetMahPuppy


People also ask

What is the best folder structure for react?

The simplest folder structure for this case seems to be the “group files by their types” option mentioned in the React docs. This makes our lives easy: Components go in the components folder, hooks in the hooks folder, and contexts in the contexts folder.


1 Answers

I recommend using Flux or something similar and then putting the actions/stores/dispatcher/etc in their own folders. This is my app structure: React Native app structure

like image 141
eyal83 Avatar answered Sep 27 '22 22:09

eyal83