React is a declarative, efficient, and flexible library used for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”. React is chosen by developers due to the following reasons.
- It is fast: Applications that are made in react handle updates quickly while remaining responsive.
- Scalable: React can display large programs with a lot of changing data.
- Flexibility:It can be used to handle the view layer for web and mobile apps. it has made the Creation of Dynamic web applications is easier as it make use of JSX which has a particular syntax and lets HTML quotes and tags to render particular sub components. React Native is great for mobile application development as react provides similar design patterns to facilitate the transition process between web and mobile application development.
- Easy to learn: Anyone with a basic previous knowledge in programming can easily understand React .To learn react, all you need is basic knowledge of CSS and HTML.
- Data binding: It uses one-way data binding and an application architecture called Flux controls the flow of data to components through one control point – the dispatcher.
- Testability: Applications developed in react js are super easy to test. React views can be treated as functions of the state, so we can manipulate with the state we pass to the ReactJS view and take a look at the output and triggered actions, events, functions, etc.
React can be used for your own projects, big and small or to build big sites likeNetflix,Facebook,Instagram,AirbnbCloudflare,Dropbox,BBC,Flipboard,Imgur,Postmates and Reddit.
Where to learn React
React can be learnt freely online or through paid online courses or physical classes. The following are platforms where you can access react courses and tutorials.
Free code camp.
How to setup local environment and build your first react app
1.Download and install a code editor. In this tutorial, I am using the Visual studio code simply known as vs code which I installed a few weeks ago.
2.Download and install Node JS. Node JS is required to run the react app.You can learn how to install Node for Windows here.
3.Then install React using the command line.
npx create-react-app first-app (first-app is the name of my application)
If you had tried to install React before,you will get the following message.
4.If you are getting this error, follow the next step.
5.Then install it globally using the following command.
npm install -g create-react-app
6.Then install the react app by the command
npx create-react-app first-app <Nameof
Once the app is created,you will see a “happy hacking” message.
Open the app.js source (src) file using the code editor and modify to build your application.