What is React Why to use ?
What are the main differences between Vanilla JS and React JS:
1-) Vanilla JS requires a lot of typing
JS requires a lot of codes so would be little messy and that make it less efficient than React.
as you can above code, if we want to add click event to a piece of data. We have to find element as I did on the first line of code with on line 56, const utility and find it first li, on line 64, and do some conditional with the li’s inner HTML, so basically there more steps to do with JS than React JS.
2–) Vanilla JS is fragile
Vanilla JS is quite fragile as we use same example with the above, when you look at the const li, on line 64, I’m trying to find first li with typing  to end. So that makes this code fragile that after a little more time later, by mistakenly if I add one more li above to this li, our event listener won’t work because we have made first li different one anymore.
3-) React JS is for code organization
ReactJs is great for organizing the code. as you can see all the above code is on one page, script.js. on the other hand when you look at the below files ReactJs files, components and containers, So we have many files and folders with ReactJS to organize our code, each file has unque task. It is better that typing everything in one file as we did in JS.
4-) React JS files are reusable
If I’m making a Twitter clone, I want “like” buttons everywhere. Each tweet should have one. And they are all going to do the same exact thing, just with different data. With React, I just need to make one “LikeButton” component and drop it in wherever I want it (from, https://www.reddit.com/user/MetaSemaphore/)
There are more than four differences between Vanilla JS and React JS, but I found that those are main differences.
What And Why React.js