• React vs. Vue in 2021: Best JavaScript Framework
  • Originally written by Elizabeth Lvova
  • The Nuggets translation Project
  • Permanent link to this article: github.com/xitu/gold-m…
  • Translator: keepmovingljzy
  • Proofread: Chorer, Hoarfroster

React vs. Vue who is the best JavaScript framework of 2021

We’ve put together this handy guide to help you better understand the Vue and React usage scenarios and determine which framework is best for your next project.

Because JavaScript frameworks are critical to Web app development, many companies have been torn between using React or Vue in their projects. The short answer is no clear winner. Each framework has its strengths and weaknesses, and can be adapted to different applications. So we’ve put together this handy guide to help you better understand the Vue and React usage scenarios and determine which framework is best for your next project.

Vue.js vs. React — What are they?

React and Vue are open-source JavaScript frameworks that make it easier and faster for developers to build complex user interfaces. Before we compare React and Vue, let’s give a brief overview of each.

The React framework provides more flexibility by using ‘components’ that developers can use to create more complex logic and interfaces with a small piece of stand-alone code. React interacts with HTML documents through a “virtual DOM” (a copy of the real DOM), but all elements are represented as JavaScript objects. These elements, along with React’s declarative programming style and one-way data binding, simplify and speed development.

Vue also provides bidirectional bindings and components, and uses the virtual DOM. The main attraction of Vue, however, is its progressive design. Vue is designed to allow developers to migrate existing projects into the framework step by step, migrating features one by one, rather than all at once. Therefore, depending on your project requirements, you can use Vue as a complete framework or a lightweight library, or something in between.

The same

As you can see, Vue and React are very similar in many features and functions, the biggest similarity being their use of the virtual DOM.

React and Vue have the following similarities:

  • Work with any existing Web app.
  • Provide developers with a lightweight way to get things done quickly.
  • Provide a component-based architecture with a lifecycle approach.
  • Provides better flexibility, speed and performance.
  • Has a large and active community.
  • Provides a wide range of libraries and tools.

The difference between

While there are many similarities between React. Js and vue.js, there are some differences between the two that have a major impact on what scenarios each is best suited for. The main difference is the way content is rendered into the DOM. Vue uses HTML templates and JSX, while React uses only JSX, which is essentially an extension that allows you to insert HTML directly into JS code. While JSX can speed up development and simplify larger, more complex tasks, the downside is that it can also complicate tasks that should be easy.

In addition, React’s core provides components, DOM manipulation, and component state management. Everything else is supported by community developers. While experienced developers generally prefer this freedom, newcomers can feel overwhelmed by the plethora of third-party libraries and tools.

While Vue has a wide range of community build solutions to choose from, its core team also builds and supports common tools and supporting libraries such as VUE-Router, Vuex, and Vue CLI. This combination of pre-built and third-party resources helps meet the needs and aspirations of both beginners and advanced developers.

Vue vs. React Performance

React and Vue have many similarities, so their overall performance is roughly comparable. Both frameworks use virtual DOM and lazy loading to improve performance and page loading speed.

However, in some cases, one framework performs significantly better than the other. For example, when you change the state of a React component, all components in its subtree are rerendered. In Vue, however, dependencies are tracked to prevent unnecessary rerendering. While you could use immutable data structures, shouldComponentUpdate, or PureComponent to prevent re-rendering child components in React, this would add additional complexity and result in inconsistent DOM state.

1. Application architecture

React differs from other frameworks and libraries in that it does not have a built-in architectural pattern. It uses a component-based architecture, which has both advantages and disadvantages. React UI renders components in the form of functions and responds to changes in data. Thus, the internal architecture consists of continuous interactions between component states and user actions.

Vue focuses on the ViewModel method of MVVM mode, which can be applied well to larger applications. It uses two-way data binding to connect the view to the model. The main goal of Vue is to provide a simple, flexible view layer rather than a full-fledged framework.

2. Scalability

React has the advantage of being scalable when considering React and Vue for large applications. Because React applications only use JavaScript, developers can easily extend them using traditional code organization. The reusability of components enhances React’s extensibility.

Although Vue is also extensible, it is more commonly used in smaller applications due to its wide selection of flexible tools (although the size of the application depends on the architecture). Because of the dynamic architecture, you will need to leverage Vue’s libraries and Mixin elements to overcome scaling limitations. So if you’re considering React versus Vue as an enterprise application, React might be better suited for future growth.

3. Document

In terms of documentation, Vue is the clear winner. Vue’s website features excellent quality, highly detailed descriptions, multi-language support, and its documentation and API references are generally considered among the best in the industry. You can find many questions and detailed answers in the documentation. However, because the Vue community is not as large as the React community, you may have a hard time finding the right answers to questions not covered in the documentation.

React’s documentation is nowhere near as good as Vue’s, so you need to turn more to the community to solve challenges and problems. Fortunately React has a large and active community with a wide selection of learning materials.

4. Community support

This brings us to the React and Vue community support. This is an important part of any technology, as the community helps new and experienced developers and creates third-party solutions and tools.

React was developed and maintained by Facebook, which also uses it in its own applications. As a result, it has a lot of ongoing support and an active community that is constantly building and maintaining new tools.

Vue was created by developers, not a company, so it didn’t catch on as quickly as React did. In fact, when it was first released, many developers found it unreliable and were hesitant to use it. However, thanks to the continued support and contributions of the user community, Vue has grown substantially and is increasingly popular.

The growing popularity 5.

Without a doubt, Vue is the most popular JavaScript framework with 181K Github Star. React, however, rose to second place with 165,000 stars and continues to grow and gain new users. Many well-known companies have Web applications that use vue.js and React.

Vue users include:

  • Gitlab
  • Euronews
  • Adobe Portfolio
  • Behance
  • Alibaba
  • Trustpilot
  • Vice
  • Nintendo
  • BMW

React users include:

  • BBC
  • Airbnb
  • Facebook
  • PayPal
  • The New York Times
  • Netflix
  • Instagram
  • Twitter
  • WhatsApp

6. Security

Both Vue and React have their own security risks, but Vue applications are easier to secure than React based applications. While automatic protection cannot be enabled for XSS vulnerabilities, for example, Vue developers can clean up HTML code or use external libraries to help defend against attacks before implementation. As long as you know the HTML is safe, you can render the HTML content explicitly before and after rendering and protect the application.

React security relies on developers using security best practices to defend against XSS vulnerabilities, server-side rendering attacks, SQL injection, and other threats. This could include things like using the Serialize-javascript module, exploiting scripting injection vulnerabilities, and using the secure React Native application. So while React is easy to use, a lot of expertise and experience is required to ensure that React applications are secure.

7. React vs. Vue Job market

React’s popularity means there are plenty of experienced developers to hire. According to the 2019 Front-end Tools Survey, more than 48% of developers are comfortable with React, while only 23% claim to have a comfortable development experience with Vue.

However, HackerRank’s developer skills report found that while 33.2 percent of companies want to hire React developers, only 19 percent have the required skills. While 10% of companies need Vue developers, only 5.1% are qualified.

Vue continues to grow in popularity and ranks fourth on the list of technologies developers want to learn in 2020. This growth in popularity, coupled with Vue’s excellent documentation and easy-to-learn knowledge, is likely to increase the number of qualified Vue developers.

conclusion

All in all, React has more enterprise support, is more popular with developers, and has a large community that can answer any questions you might have. It is also easier to scale and is often preferred for complex enterprise-level applications.

On the other hand, although Vue is not yet widely supported and used, its popularity is growing, mainly due to its excellent documentation, ease of use, and incremental use capabilities. Vue also offers more core support and a wider range of built-in tools and solutions. When you consider the React and Vue development speed, using Vue CLI 4, you can build and deliver a product that meets market requirements in just a few weeks.

Obviously, both frameworks are excellent frameworks for modern Web applications, and the pros and cons of React versus Vue vary depending on your usage scenario. Which one to use depends entirely on your project goals and preferences.

React is the better choice if you want to:

  • Flexible libraries, tools, and ecosystems.
  • Easy to use with TypeScript, Flow, ReasonML, BuckleScript.
  • Develop a highly scalable application that is easy to test and debug.
  • Build a complex application quickly.
  • Create a high-performance video streaming platform or media website.

Select Vue when you want to:

  • Build a progressive Web App or SPA.
  • Start development immediately.
  • Get more core tools and support.
  • Extend the functionality of existing apps.

We hope this guide will help you decide whether to use React. Js or vue.js for your next project. If you have further technical questions, or you need an experienced development team to help create your project, please send us a message using the form below!

If you find any mistakes in your translation or other areas that need to be improved, you are welcome to the Nuggets Translation Program to revise and PR your translation, and you can also get the corresponding reward points. The permanent link to this article at the beginning of this article is the MarkDown link to this article on GitHub.


The Nuggets Translation Project is a community that translates quality Internet technical articles from English sharing articles on nuggets. The content covers Android, iOS, front-end, back-end, blockchain, products, design, artificial intelligence and other fields. If you want to see more high-quality translation, please continue to pay attention to the Translation plan of Digging Gold, the official Weibo, Zhihu column.