BASICS ON REACT
React
React is a JavaScript library for building User Interfaces
React. ReactJS and React.JS are all the same
History of React
It was created by Jordan Walke, a software engineer at Facebook.
React was released in the year 2013.
User Interface is a point of human interaction and communication
Why React
- It implements a component based Approach.
- Uses a declarative Approach
- DOM updates are handled gracefully
- Reusability of code in React
- Learn once, write anywhere
React is designed for speed, speed of implementing the application for simplicity and scalability.
During implementation of React, the following should first be considered:
1.Babbel->This is a transpiler
This Babel converts your JSX to pure JavaScript code, and the latest JavaScript to pure older version of JavaScript.
2.JsX: This is a combination of JavaScript and normal HTML.
Forexample:
const name = <h1>Anurag</h1>
To include JsX element inside another element, we always use
{}
.
- And to start working out with the react and related manipulations, we need the
npm
andnpx
.
We use npm when we want to install a package in our whole system, yet for **npx*, we use it when working on a specific document thereby installed at that moment, for only that project we are working on.
States in reactJs
A state is a React-object used to contain or store information or data of a component.
- Incase anything is changed on a given webpage, the state thereby changes and hence, is also modified by default.
HOOKS
Hooks generally capture data.
- For any hooks, they hold a parameter that holds the initial value.
Examples of commonly used Hooks
UseEffect()
UseState()
Top comments (0)