REACT.JS

 INSTALLATIONS

* React is a javascript library for building the user interfaces

* npx create-react-app rishabh    ===for creating the react app

* in the node module all the node module will be start

* src is a important file and we will mostly work on this

* index.js is responsible for starting up the react application

* app.js is an important file and this is our root component file, this is responsible for displaying up the HTML in browser, this contain react component which contain HTML content that is displayed to the user and the js code required by the html

COMPONENTS

* components are building block of the application and you can create as many component you want,

suppose you want to build a site it have navbar, body and footer so you can make three component and in future you can reuse those components

* we have function component and class component

* in function component are javascript function, we can use the functionality of class component in function component with the help of react hooks

* class component are js classes and they are stateful component

*class components are js ajax classes and also they are stateful component it means class component maintain their own data which is called state

PROPERTIES OR PROPS

* Using props you can send value from one component to another component, props can be used in function as well as in class component

* there is one problem with props that you cannot change the props

EVENT HANDELING

* We can also use our function as props in a react js for a class based component and perform event handeling

ADDING BOOTSTRAP STYLES

* In this you will see how can you use bootstrap in your react application

* npm install bootstrap   then import bootstrap in index.js

* in React js we use div className not class when using bootstrap classes

WORKING WITH STATS

* there is difference between props and stats , props and stats both are used to holding the data, with props we can send data from one component to another component but stats are added with the component

* props are immutable you cannot change its value but stats are within the component so we can change the component with stats

* you can use STATS in the class component  but if you want to use STATS in the function component then you have to use React hooks

* For adding the STATS you need to create class constructor , we put stats in constructor class

*setState is a reserved keyword used to the setState

MAP FUNCTION 

* ES 7 plugin install in vs code  : - this helps in creating the function component with keyword 'rfce'

and class component with 'rce'

*and if you want to create constructor use rconst

* Example.js and Example2.js check out for this

WORKING WITH FORMS

* we can also add input field in it like HTML but quite sopheticated process

 ROUTING

* It's kind of url thing that we can integrate in this, by installing the package like npm install react-route-dom

REACT CONTEXT API 

* Context provides a way to pass data through the component tree without having to pass props down manually at every level.

* video dekh lena

REACT STATE HOOK 

* Hooks let you use state and other React features without writing a class

* on clicking item increase like thing happens without refreshing the page and shown in the same page

REACT EFFECT HOOK 

* Effect hook lets you perform side effects in function components

* mount wala kaam krta hai, for fetching API and all

* to fetch data we have to install library called axios

* website for fetching the data is jsonplaceholder.typicode.com/posts

REACT USE CONTEXT HOOKS 

* Context provides a way to pass data through the component tree without having to pass props down manually at every level

REACT USE REDUCER HOOKS 

* This is an alternative to the userState

* 



Comments

Popular posts from this blog

Django

JS

chat model