React
#
Application structureBelow are the main files and directories. The main structure remains well inline with Create React App, with some Atomic design principles for React components.
Location | Purpose |
---|---|
src/ | Only files inside this folder are processed by Webpack |
src/index.js | The JavaScript entry point |
src/App.js | The root React component for the application. Here all page routes all delegated to the router, as well as some base layout |
src/Components | Standard React components |
src/Blocks | Blocks are components which are "building blocks" of a page layout. They are always full-width and can be stacked on top of each other. They may make use of standard components |
src/Containers | Containers generally wrap React components or blocks, to supply data or interact with the API. This creates a seperation of concerns and allows for more modular, re-usable components |
src/Pages | Each page is a route or template used by React router |
public/ | Static data. Only files inside public can be used from public/index.html |
public/index.html | The static html file where React will mount to |
build/ | The build output folder. Completed build appears here after running npm build |