React with me

·

1 min read

Day 2

Today I Created my first React Project called Counter where I used my first hook "UseState" for it. Also you cannot use return counter and increment or decrement on mouse click. You'll have to use hooks for the changes so it will be shown in the UI. As React uses virtual DOM for the changes and not the browser's DOM.

Source for UseState - https://react.dev/reference/react/useState

Source for the Project- https://github.com/piyusss11/Counter_via_React

React runs a reconciliation algorithm which differentiate one tree with another to determine which parts need to be changed. Reconciliation is the algorithm behind what is popularly understood as the "virtual DOM." When you render a React app a tree of nodes that describe the app is generated and stored in the memory. Then this tree is rendered , and if there is any updates in this tree then its diff from the previous state to compute which operations are needed to update the rendered app.

Source for Reconciliation algo - https://github.com/acdlite/react-fiber-architecture