








React is a javscript libray. When we run react project then react render orginal dom and create a virtual dom in memory . And browser shows orginal dom. When we make some changes then react create a new dom and the previous virtual dom is compared by the diff algorithm. And virtual dom changes only what needs to be changed and replace changes in the browser. Virtual dom updates what we changed. For this reason browser don't need to be rerender again.
Usestate is a react hook. Acctually in the usestate we pass intial value and useState hook returns us a variable and a function . We set usestate intial value and we update intial value using setvalue function . And in the usestate hook we can declare variable on react components. In the usestate we can pass an object or an array or a bollean etc. And Usestate Retuns an array.