»
004. Why ReactJs
I've been thinking: Why use React?
All frontend developer will answer:For componentization. And only after comparing development efficiency, we can know the real reason. That is for the efficiency of collaborative development among numerous developers, rather than for the development of a single developer.
Long time ago, when I was busy with web apps, I used jQuery+HTML page implementations. The running speed is extremely fast and the running effect is particularly good. The development efficiency is also particularly high.
So, I was thinking that if all the dialogs in the page and styles on the page were written by myself after UX design, then, using jQuery could achieve all the effects that React can achieve. So, why we still use React?
When I finished developing one pop-up dialog to another... While I was busy, I realized why we should use componentization and why React were necessary.
In jQuery+HTML pages, all UI and div page content are within the same HTML page.
Create a pop-up dialog by creating a new <div> in the same HTML file, add background CSS, adjust the window frame style and padding, and finally fill in the content inside the dialog. The efficiency of one person's development is indeed not low.
However, if this web app has numerous dialogs with different styles, and if we have a short development period. It will require several frontend developers to develop simultaneously to shorten the development period. At this point, more than N developers start modifying the same HTML file, and the possible conflicts of n CSS among N developers begin. Ultimately, this resulted in many developers spending a lot of time merging code, merging individual HTML contents for single page applications, and much difficult to be found in CSS nested definitions.
In order to resolve the conflict between code merging and the conflict between style definition and JS variable definition, frontend frameworks were born in the world. In frontend frameworks such as Angular, React, and Vue, each component can be a separate file, and each component can have its own CSS style definition. You manage your window code, I manage my dialog code. Everyone can work on the same frontend interface without interfering with each other. This is the componentization.
That is to say, component-based code development easys facilitates collaboration among multiple developers. That is to say, the advantages of Angular, React, and Vue.
---- www.v-signon.com Learninger Co-Encourage