Skip to main content

Command Palette

Search for a command to run...

React App Hierarchy

Published
•1 min read•View as Markdown
React App Hierarchy

Let's Understand the typical React App hierarchy-

  1. public folder: contains the index.html file that serves as the entry point for the app and other static assets such as images and fonts.

  2. src folder: contains the main source code for the app. It typically includes the following subfolders:

    -> components folder: contains the individual react components

    -> pages folder: contains components that correspond to pages in the app.

    ->assets folder: contains images, fonts, and other assets used by the app.

    -> App.js: the root component that ties together all the other components in the app

    -> index.js: the entry point for the app that renders the App component into the DOM.

  3. node_modules folder: contains the dependencies installed by npm.

  4. package.json: contains the metadata for the app, including the dependencies and scripts used by the app.

  5. .gitignore: lists files and directories that should be ignored by Git.

  6. README.md: contains information about the app and how to set it up.

PS: This file hierarchy may vary based on the specific needs of the app and the developer's preferences, but this is a general guideline for a React app.