React Learning Summary - Day 1,2
This is my second day of learning react from Hitesh Sir (Chai Aur Code), till now i learned how to make a react project, we can make it with help of create app or bundlers like vite, parcel. Also I studied the difference between making react app from this different ways. Furthermore, i came to know the file structure of the react. I came to know that entry point of the react is package.json, there is all things written in package.json like version, which dependencies are provided, scripts to run a react project and many more.
The difference between creating React app from create-react-app and with vite is that vite is light weighted, on other hand create-react-app is bulky, it gives extra and unwanted dependencies that makes it bulky.
On third video i studied what is behind the scenes of react, like how javascript injects the element into HTML without taking reference in the HTML, this is second difference between vite and create-react-app, that is in create-react-app, react-scripts adds the script tag in html to give reference of the javascript to html, on other hand, in vite, script tag is already declared inside html, another difference is that in vite we have to give extension as .jsx, but in create-react-app .js will work. And i studied the best practices such as, the function name that return the HTML should have first letter capital, and inside return we can only return one element, so to bypass this limitation, react comes up with clever idea that return multiple tags/elements wrapped in one element, it can be div, section or it can be empty tag, that is: wrapped in <> </> this tag.
In Fourth video, i studied full internal working off react, that is how react renders the html, how internal things works. React parse the html element into tree structure and tree structure into objects. When we define a function, react internally converts it into tree structure and tree into object with more optimizations. So , if instead of giving the function, if we give the object with syntax declared inside react, with the help of react.createElement, then we surpass one step of parsing the function into object, so it will also work, but the best practice is to make function, this is only for understanding of internal working of react. In this we created custom react, and i manipulated it and i now have an overview that how internal things works!
And the most important thing that hitesh sir has done is they guided to source code of react, even though i dont get any code, i didnt understand anything what is written but i understand how internally that object is made and what parameters it excepts.
This is short summary of 2 days of learning react from hitesh sir(chai aur code), Thanks sirr for your guidance.
