The importance of folder organization for the success of React native applications.

·

1 min read

An important success factor of any React native application is its file organization system.

While researching the topic, one specific practice surrounded by two key principles came into mind.

The practice involves primarily separating folders between containers and component folders. Secondarily all the files inside each folder must be organized according to their specific purpose. For example, this is a glimpse of the organization of the files inside the components folder:

  • src/screens: Contains individual application screens.

  • src/components: Stores reusable UI components.

  • src/utils: Holds utility functions or helper modules.

  • src/assets: Houses images, fonts, and other static resources.

  • src/navigation: Includes navigation-related files.

source of the structure: https://www.linkedin.com/pulse/structure-your-react-native-app-scale-part-1-patterns-malik-chohra-qqjve/

The principles surrounding this practice are the following:

  • Single repository principle: This advocates for a single repository of sensible and important information;

  • Directory structure: This advocates for a functional separation of the folders in Container and Components, and a separation of the files according to their specific functions.