Comments

React vs. Vue – A Wholesome Comparison

React Vs. Vue

React Vs. Vue

React and Vue are the two most popular JavaScript libraries that are being used to build thousands of websites today. If you have to pick React vs. Vue which one should you pick?

There is no right answer to this question. The answer to this question depends on your business needs and use-cases. Both React and Vue are powerful contenders with their own set of pros and cons.

Both Vue and React have a lot in common like the component based architecture, usage of virtual DOM, usage of props, chrome Dev tools for debugging and many more. But both of them won’t exist if there are no significant differences.

Let’s explore React vs. Vue against several factors.

Corporate Backing

React:

React is backed by Facebook and was open sourced by Facebook in 2013. Facebook has a dedicated team of engineers who are working on React and making React better everyday. Since Facebook is heavily invested in React, many internal Facebook products are coded in React. With Facebook’s heavy involvement in React, the library has gained a lot of trust and popularity over the years.

Vue:

Vue is not backed by any big corporation like React. Although Vue is not backed by big names, it has gained a huge popularity in the open source community. It is fairly new compared to React and is backed by a group of open source contributors.

Winner: React

Code Style And Learning Curve

React:

React uses JavaScript Expressions (JSX) which is a way of writing HTML within JavaScript code. JSX makes sense since React believes in functional programming.

For a typical web developer, initially JSX could be bit of a learning curve. Although, JSX is a different approach, it is very similar to HTML and a developer should be able to grasp it with some practice.

React also treats everything as a component, and each component has its own component lifecycle. React has lifecycle methods, that handle these components. You can learn more about React lifecycle methods from my blog post.

Vue:

Vue’s coding style is similar to what web developers are used to before the advent of React. Vue separates HTML, JavaScript and CSS like the traditional way of coding web applications.

It does allow JSX, if that is your preferred code style.

Vue also has component lifycycles, but they are simple and much more intuitive than React. Vue also is a younger framework, so it made sure it took the best of React and addressed some of the problems with React.

Based on the comparisons of code style, if you are a JavaScript developer who has not used React or Vue, you will find coding with Vue easier and more intuitive.

Winner: Vue

Documentation

Although Vue is the youngest framework in the JavaScript space, it has the best documentation hands-down. Vue has been appreciated by many developers for it’s clear and concise documentation. Hence, new developers love to get on-board with Vue since it is easy to navigate through the concepts.

The React documentation is getting better off-late and the React core team is taking an effort to make the documentation better. But if you were to compare documentation of React vs. Vue today, the clear winner is Vue.

Winner: Vue

Framework Size:

Vue is smaller than React. React is considered quite small when compared to Angular and other frameworks, but Vue happens to be smaller.

Vue is not the smallest solution out there. Preact is smaller than Vue, and it is basically React, with some features stripped out. The image below shows where Vue and React fit it in terms of size.

Source: https://medium.com/dailyjs/javascript-framework-battle-hello-world-in-each-cli-cfdba8bf5e4b

Winner: Vue

Mobile – Native Rendering

React: 

React Native has evolved from React, and is the mobile solution to build native mobile apps using JavaScript and React. Today many fortune 500 companies are using React Native for their mobile space, and I am a React Native developer too and can vouch for its awesomeness.

React Native is also backed by Facebook and was open sourced a few years ago. A React developer can easily pick up React Native, since the code is all written in JavaScript and React. The only difference is that instead of web components, React Native comes with native mobile components for iOS and Android.

Vue:

Vue does not have anything in the open source space today as an equivalent solution to React Native. So Vue developers cannot leverage their knowledge to make native mobile apps using Vue today.

Although there is no solution that is available to use today, Vue does have a collaboration with Weex, which is a cross-platform UI framework from the famous Alibaba group. This uses Vue and could be a potential counterpart to React Native in the future.

Winner: React

Flexibility

React:

React is not an opinionated library. This could be good and bad depending on your perspective. I personally like that React offers a lot of flexibility and developers can choose their path.

For instance, React does not offer routing options, instead we can go with a third party solution for routing. React router which is a popular routing option is not a part of the official React library. Advanced state management can also be done with third party library support. You could use Redux, MobX or any other library for state management. This shows that React is flexible with the way you want to route your application, manage state etc.

But to a new developer this maybe a bit overwhelming since they have to shop for options instead of getting these out of the box. Experienced developers love this flexibility since they can leverage multiple options that are out there.

Vue:

Vue is also a flexible framework. But, Vue is more opinionated than React. Unlike React, Vue offers Vuex for state management, Vue Router for routing,  Vue Server-Side Renderer for server-side rendering all as a part of the official VueJs GitHub page. The Vue.js framework by itself comes bare-bones just like React, but they have all the add on items on their official page as their pick.

Again, this could be good for a new developer who wouldn’t need to spend time shopping around for options.

In my opinion I like the flexibility offered by React over Vue.

Winner: React

Job Prospects

Since, React has been around for a while now and is used in several businesses all around the world, it leads to better job prospects.

We probably cannot come to a quick conclusion about Vue based on the jobs available today. Vue is still young and upcoming, and few years down the lane there maybe a demand for Vue developers. But as of today there are plenty of React jobs when compared to Vue jobs in the market.

So learning React might be more beneficial if you are on a look out for a JavaScript job soon.

Winner: React

Verdict:

Source: https://vuejsadmin.com/

Picking React vs. Vue, totally depends on your business use-cases. If you are looking to build complex applications, with support and potential to hire more front end developers with experience React maybe a good choice. But if you are looking to build something very simple, easy with a fast turnaround time, you could go for Vue with the support of templates which are easy to learn and code.

If you are potentially going to code a mobile version of your website with code sharing, you should consider React since the code can be shared between React and React Native, and there is no counterpart for that in Vue.

If you are a beginner to React, and want to master it, I highly recommend taking Mosh’s course on Mastering React.

Did you like this post? If yes, please share it friends and colleagues.

Adhithi Ravichandran is a Software Consultant based in Kansas City. She is currently working on building apps with React, React Native and GraphQL. She is a Conference Speaker, Pluralsight Author, Blogger and Software Consultant. She is passionate about teaching and thrives to contribute to the tech community with her courses, blog posts and speaking engagements.
Tags: ,

11 responses to “React vs. Vue – A Wholesome Comparison”

  1. Mii says:

    Thank you for this blog.

    Vue has vue-native today since June 2018 but I love React!

    • Interesting. You are right Vue Native has been released recently, but Vue Native is a wrapper around React Native APIs, which allows you to use Vue.js. So technically it is React Native under the hood, but you can code it using Vue. But like you said, I love React too.

  2. It’s very good and helped me to choose between React and Vue.
    Thanks!

  3. I am new in web development and it was so helpful . thanks
    plus it was a great pleasure to see your family name !
    actually I born in Hamedan ! 🙂

  4. Thanks for great post .. it helped me to prioritize both libraries

  5. Ashish Goyal says:

    Great post.

    I also wrote for comparison of React vs Vue.

    Read here: – https://xtreemsolution.com/blog/React-js-vs-vue-js

  6. Anand says:

    Nice post, I’ve been using vue for few months now and loved its simplicity. Would recommend it to anyone looking to implement quickly. I was looking at react first but disliked its event binding code and seemed steep learn too.

  7. Stu says:

    Thanks for your post, it made for a worthwhile read. I do have a couple of comments though. Firstly native mobile apps seem out of date now that PWAs allow for store downloads as well as web installs, and as both can be used to create PWAs I don’t see React as a winner. Secondly I recently had to do a round of recruitment for React coders and I was surprised to find that the majority of applicants had Vue experience rather than React, presumably because of the easier learning curve. Because of this I am seriously considering Vue as a choice for my next project simply because I know I can staff it easier. I’m sure that I’m not alone as an employer with this. So with that said, I would say they are both on equal footing when it comes to employment and I would lean towards Vue as being the potentially the most employable in the future. Thanks again for your post though, I enjoyed it very much.

Leave a Reply

Connect with Me
  • Categories
  • Popular Posts