DEV Community


Discussion on: React vs Vue: Compare and Contrast

dinsmoredesign profile image
Derek D • Edited

Personally, it boils down to the ecosystem for me. React has a very vibrant community, but that is both a plus and negative IMO. The React landscape is constantly changing. New, innovative, things come quickly, but the community is so fragmented on how to do things, it makes it harder to just pick the right tools and start working.

Outside of Context and Hooks, for state management, React has so many options:

  • Redux
  • Mobx
  • Unstated
  • Recoil
  • Kea
  • Stator
  • Etc.

Vue has an official library - Vuex.

Routing in React is different from pretty much every other library ever made. Instead of creating routes as objects (controllers), they are created as components inside the JSX. React Router v6 will FINALLY allow route definition by object, but it's still in alpha last I looked.

Vue offers this now, with an official router plugin.

React has a million ways to style components, few of which actually use basic CSS.

Vue allows you to use CSS, SCSS, etc and scope them to the component without an effort. Just add "scoped" to the style tag. You can also export it as a module with "module", instead.

Building something as simple as a form should be... simple. Not in React. There are countless packages to handle forms because doing it is cumbersome with 1-way data binding.

With Vue, just add v-model to your from element and your values magically update on each input.

Create-react-app is limited and assumes you'll only build your app a certain way.

The Vue CLI is super flexible and prototyping and scaffolding apps is super simple. They even have the Vue UI app built in to give the CLI a GUI.

JSX has first class support in Vue, too. So does Pug. Both are configuration options in the CLI. You don't have to use the template system.

The thing with React is, you HAVE to add so many libraries to it, because it's not really that powerful without them and with Vue, there's not many libraries you have to reach out for besides what's included in the "core" ecosystem.

IMO Vue is going to get a huge spike in popularity this year, once v3 is released. First-class TypeScript support, Hooks, fragments, portals, suspense and an even smaller bundle size with faster response times, all with a strong core ecosystem.

Don't get me wrong, I love React. If it weren't for React, Vue 3 wouldn't be shaping up to be so awesome, but I'd have a hard time recommending it for anything other than the fact that there are more React developers than anything else right now. IMO, picking something based on popularity isn't a good idea, though, unless the other option is so small its longevity is a concern.