ReactJS was created by Facebook and maintained by it, although it is open-source. Facebook’s internal system uses React, so they maintain and support it. It has more then 157K stars on github, which means it is loved by developers worldwide.
It has a huge community since it was released in 2013. You can find tons of article, youtube videos on React. And almost all error solution on stackoverflow. It is the most demanded skill for Frontend developer even more then Angular and Vue. After learning ReactJS for web-development, you can learn React Native, which is almost similar to ReactJS. With React Native you can developer cross-platform ios and android apps.
ReactJS have a component based architecture. Everything is divided into component and we can reuse them. Like the below simple app for a Youtube player. Here, the search bar is a component, then the video player is a component and the video list is the other component.
In ES6 you need to learn -let and const, arrow functions, template literals, default parameters, object literals, rest and spread operators and destructuring.
Now, to start with React app you need to have NodeJS installed on your machine. So, head over to https://nodejs.org/en/ and install it according to your operating system.
It is also advisable to use VS Code editor, but you can use any other light-weight code editor like Sublime and Atom. You can download VS Code from https://code.visualstudio.com/
As with any other language we will start with the legendary Hello World program. But first we need to create a react app and the good people at facebook have made it very simple for us with the use of just one command. Use the below command in terminal(mac and linux), command prompt or git bash(Windows).
npx create-react-app my-app
The details can be found in the https://github.com/facebook/create-react-app
One thing to notice is that now their is only this method to create a react app, as the other method with globally installing create-react-app is deprecated now.
I have created a folder React in my Desktop and using the command from a git bash terminal in Windows.
It generally takes 5 minutes to install all dependencies. If everything is ok, you will get the below message.
As per the instructions, we need to change to the hello-world directory and run yarn start. But we can run npm start also, as I prefer npm over yarn. So, i am running below command after cd to the directory.
Our web-app will start successfully start on http://localhost:3000/ in the web-browser.
This completes part-1 of the series.