4 min read.
1- Node js.
2- npm (Node Packages Managers) or yarn.
npm install -g create-react-app
Now we’re done with setting up React environment, let’s start creating our first React app.
It may take a while to create the app, When it finishes, go to application folder and run npm start.
The previous code will open the application on “ http://localhost:3000/”.
After you’ve started the app, go and open up the application in your text editor and let’s have a look at the basic files structure and discuss the commonly used files.
1- Create react app has already installed several files for you, and organized several of them into folders, your main folders are src and public folders.
2- Create react app installs several react scripts for you as well you can find them in the package.json file.
3- If you want to add any external stylesheets you would link it up in index.js located in the public folder. You can also change the title of the application. Other than that, you won’t usually need to touch this file very much.
4- The next file is the index.js located in src folder.
5- One of the most important features about React is using components. You can create your app components in a sub-folder called components in src folder and then link them all in app.js folder ad it’s the entry point for your application.
Note that this is such a basic structure and there’s a lot to add in your project. But I wanted to make you familiar with the basic files and folders.
Congratulations, Now you are done with your first React app and can deal with your project files. All comments and feedback are highly appreciated.
Stay tuned for more React Js articles for beginners, Have a nice day 🙂