Friday 7 October 2022

React

React is a widely used JavaScript library that was launched in 2011.It was created by developers at facebook, and it is primarily used for frontend development.

React is a JavaScript library for building user interfaces. More specifically, React provides a declarative library that keeps the DOM in sync with your data.

The architecture is component-based and allows you that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps. 

React does not have templates because it just relies on JavaScript combined with JSX so it is often favored by developers who are fluent in JavaScript

What is single page application?

A single page application is a web application that dynamically rewrites a current web page with new data from the web server, instead of the default method of a web browser loading entire new pages. Eliminating full page reloads results in less wait time between the browser and host for the user.

React Hook?

Hooks allow us to "hook" into React features such as state and lifecycle methods.

Types of Hooks:

custome Hook

useState Hook

useEffect Hook

Redux:

Normally in react always flows from parent to child components which makes it unidirectional.



















To create a sample React project ,you can follow these steps

1.Before you start,make sure you have node and npm installed on 
   your machine.
2.Open your terminal or command prompt and run the following command to create a new 
   react project using  create react app

    npx create-react-app mypractise

This command creates a new folder named "mypractise" and sets up a basic react project structure inside it.

3.After the project is created ,navigate to the project directory using the following command

     cd mypractise

4.To  start the development server and see your react app in the browser,run the following command

     npm start

This command will start the development server and open your app in the default browser.
 
5.Now you have a basic react project set up.
You can open the project folder in your favorite code editor and explore the project structure.


No comments:

Post a Comment