React vs. Vue: Why do big companies in foreign countries seem to prefer React? _bilibili bilibili
In common
- componentization
- One-way data flow, data-driven view
- use
Virtual DOM
+Diff
Algorithmic rendering of DOM- But there are differences in the implementation of the source code:
- Vue Diff uses a bidirectional linked list to compare and update the DOM
React mainly uses the DIff queue to store the DOM to be updated, obtain the patch tree, and then update the DOM in batches in a unified operation
- The community is mature and all support SSR
Why do Vue and React choose Virtual DOM
- Reduce direct manipulation of the DOM and use data-driven views
- Can be cross-platform, render to platforms other than the Web. ReactNative, Weex
The difference between
-
Different core ideas
- Vue personal development, advocating flexibility and ease of use (progressive development experience), two-way data binding (dependent collection)
- React was developed by Facebook to revolutionize front-end development. The core of functional programming was stability (no side effects) and testability (the output must be the same if the input is the same).
-
Vue uses templates to embrace HTML, React uses JSX to embrace JS
-
Vue2 uses declarative programming, while Vue3, like React, prefers functional programming
-
React “manual” (manually setState to modify the state, often requiring a variety of plugins and solutions in the community)
Lastly, why do big companies and foreign countries prefer React?
- React is widely publicized and well-known in foreign countries
- React itself has a low floor, but the ceiling is high enough that large companies can manage it