Introduction to React JS

React.js or React is one of the most popular JavaScript libraries in 2021.Other most used libraries include Angular, Vue, Ember and Meteor.js. If you are planning to become a front end developer or you already are, chances are that you have come across react. It was developed by Facebook but now it is open source.

JavaScript libraries are collections of pre-written JavaScript code that can be used for common JS tasks, allowing you to bypass the time intensive (and unnecessary) process of coding by hand.

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.
  • React is modular: It uses small reusable files which solves the issue of maintaining dense files of code in JavaScript.
  • 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.

React.org

Udemy

Plural sight

Coursera

Free code camp.

Codecademy

Glitch

Scrimba

Egghead

YouTube

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 <Name of your app>


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.

 

About: Justina Kageni

Justina Kageni is an information scientist with passion for Information Technology.She is a web developer on a mission to share her journey.

error: This content is protected !!