Let's start with React Introduction.
React Introduction
React is a JavaScript library. It was created and maintained by
Facebook. Also used for building User Interfaces. React was initially released on May 29, 2013. It was written in JavaScript.
Prerequisite for React
Before starting with React, you should know the following areas:
It is good to have additional knowledge:
- How does the browser render the DOM?
- Basic SCSS / CSS materials such as box model, position, etc.
- JavaScript core concepts. Ex- Hosting, Call, Apply, Bind, Higher-Order Function, Closure, and Object-Oriented JavaScript.
- The basic concept of web apps. Ex - Ajax, SPA (single page Application), responsive web pages, etc.
Longer Definition for React
React is only responsible for the view layer of an application. It means that it is only responsible for rendering UI (User Interface). Such as text, list, buttons, links, etc. React supports live reloading browser, as well as updating whenever the UI changes.
For example, you are creating an e-commerce website. You want to maintain the number of selected items in the shopping bag. Users will add and remove items from the bags.
You can simplify it in React. The number of selected items show in a shopping bag like {selectedItems.length}. React will display it and update it whenever it changes.
React will allow you to reuse the same login in another part of the website UI. For example, you can reuse the same logic without rewriting it on the checkout page.
React is NOT a Framework
React is a library, not a framework.
The difference between a library and a framework is:
- The library helps you on only one side
- The framework helps you on many sides
Angular is a framework. It handles many things more than UI (dependency injection, CSS encapsulation, interface, etc.). React is a library, so it only takes care of UI parts.
Read Also: https://codeshipguru.blogspot.com/2021/08/top-angular-interview-questions-and.html
For the design system, you must select the design library. Otherwise, use CSS / SCSS to make it beautiful and user-friendly.
What about Web Components?
Web components allow you to create a custom piece of reusable code. We can use it on different web pages/apps.
All web components are runs in modern browsers.
For example, we can create our new web component named <web-component></web-component>.
Also, we can add unique styling and functionality to the components. JavaScript or any library framework can use web components.
Revision
- React is a JavaScript library for building UI(User Interfaces).
- React is only responsible for the View layer.
- React is not a framework.
0 Comments