04 File Structure - biswajitsundara/react GitHub Wiki
The basic react project has the below files & folder structures
- This is the file required for every
node js
project. - It contains scripts & dependencies
- We will find two key dependencies here -
react
andreact-dom
- Then under scripts we have -
strat
,build
,test
etc - We have
eslint
configuration which will highlight syntactical errors - The
browserslist
specifies which browsers should be supported for your frontend app
- This is automatically generated when package.json is created/modified
- It contains the exact tree that was generated along with version name, subsequent dependencies etc.
- This file contains files/ folders those will not be tracked by git
- The standard read me file.
- Contains all the installed libraries
- The robots.txt, manifest.json files are meant for PWA (Progressive Web App)
-
index.html
is the main file that gets served - Typically we will not change anything in this file.
- We will connect our components to root and then
<div id="root"></div>
will do the rest.
- We will do all the work here during development.
-
index.js
renders the<App>
component to theroot
element
ReactDOM.render( <React.StrictMode> <App /> </React.StrictMode>, document.getElementById('root') );
- The app component comes from
App.js
file - The app component is the view
-
App.css
is generated for styling &App.test.js
is for unit test -
index.css
has the stylings for the body. It's referred inindex.js
file -
reportWebVitals
for the performance testing -
setupTests
is to setup the tests.