Getting Started With React
Getting Started With React
What Is React?
React (also known as React.js or ReactJS) is an open-source, front-end JavaScript library
for building user connections or UI components. It is maintained by Facebook and the
community of individual developers and various other companies. React can be used as
a basis for creating single-page or mobile applications. However, React is only
concerned with the management of the state and providing that nation to the DOM, so
creating React applications often requires additional router libraries and some customer
service.
React Features:
● Declarative: React makes it less painful to create interactive UIs. Design a simple
view of each state in your app, and React will carefully review and provide
relevant sections as your data changes. Screaming views make your code look
more accessible and easier to fix.
● Component-Based: Create integrated objects that control their state and
compose them into complex UIs. Since the concept of components is written in
JavaScript instead of templates, you can quickly transfer rich data through your
application and keep the state out of DOM.
● Learn Once, Write Everywhere: React does not bother about all of your technical
stacks, so you can develop new features in React without rewriting the existing
code. React can also render the server using Node and the power of mobile
applications using React Native.
What are Components?
Components are independent and reusable codes. They work for the same purpose as
JavaScript functions but work independently and restore HTML with render () function.
In simple words, react is like the lego game, and here components are bricks of lego
that are used to build different applications.
Class components - The class component name must start with a capital letter. This
component should contain the React.Component statement, which creates the
inheritance for the React.Component and gives your component access to the functions
of the React.Component. The component also requires a render () method, which
provides HTML.
Creates a new DOM if element updates. Updates the JSX if element updates.
What is Library?
The library provides a set of auxiliary functions/objects/modules that your application
calls for specific functionality. Libraries usually focus on a narrow range. The reason we
need the library is very simple, i.e. code reuse, use code already written by other
developers.
So React is a library that is just the view part of the MVC framework, whereas other
frontend frameworks like angular is an extensive framework that is more than the view
part of the MVC framework. According to Google statistics, react is easy to learn as it is
not so vast and is the most searchable front-end library.
Summarising It
Let’s summarise what we have learnt in this module:
● Learned about React library and components.
● Learned about single page and multi-page applications.
● Differentiated between framework and library.
● Compared React with other frontend frameworks.
Resources
Lecture Resources:
● Visual Studio Download Link: https://code.visualstudio.com/download
● NodeJs Download Link: https://nodejs.org/en/download/
Further Readings:
● Single page apps v/s Multi page apps:
https://asperbrothers.com/blog/spa-vs-mpa/
● React v/s Angular Comparison: https://hackernoon.com/reactjs-vs-angular-
comparison-which-is-better-805c0b8091b1