The essential difference between vue and react is the difference between templates and componentization; Vue is essentially an MVVM framework, developed from MVC, while React is a front-end component framework, developed from back-end componentization.
The operating environment of this article: windows7 system, react17.0.1&&vue2.0 version, Dell G3 computer.
Vue and React are two JavaScript frameworks that are popular nowadays. What is the difference between them?
Vue.js is a progressive framework for building user interfaces. Unlike other heavyweight frameworks, Vue adopts a bottom-up incremental development design. Vue's core library only focuses on the view layer, and is very easy to learn and integrate with other libraries or existing projects. Vue, on the other hand, is fully capable of driving complex single-page applications developed using single-file components and libraries supported by the Vue ecosystem.
React is an open source JavaScript library used to build user interfaces. It is mainly used to build UI. Many people think that React is the V (view) in MVC. React has high performance and very simple code logic. More and more people have begun to pay attention to and use it.
React views are typically rendered using components that contain other components specified in custom HTML tags. React provides programmers with a model where subcomponents cannot directly affect outer components ("data flows down"), efficient updates to HTML documents when data changes, and clean separation between components in modern single-page applications.
The difference between vue and react
The essential difference between vue and react: the difference between templates and componentization
The essence of Vue is the MVVM framework, composed of Developed from MVC;
React is a front-end component framework, developed from back-end componentization;
Differences in data flow:
vue bidirectional data flow React single The implementation principle of monitoring data changes to the response data stream is different
Vue can accurately know the data changes through getter/setter and the hijacking of some functions, and can achieve good results without special optimization. Performance
React defaults to comparing references. If it is not optimized (PureComponent/shouldComponentUpdate), it may lead to a large number of unnecessary VDOM re-rendering
Why React does not accurately monitor data changes Woolen cloth? This is because of the difference in design concepts between Vue and React. Vue uses mutable data, while React emphasizes the immutability of data. So it should be said that there is no difference between good and bad. Vue is simpler, while React is more robust when building large applications.
Because a data layer framework such as Vuex and Redux is generally used, this part will not be explained too much. It will also be discussed in the final difference between vuex and redux.
Recommended: "
js Basic TutorialThe above is the detailed content of What is the essential difference between vue and react. For more information, please follow other related articles on the PHP Chinese website!