DEV Community

Discussion on: This is why everyone is using Reactjs

Collapse
 
aarone4 profile image
Aaron Reese • Edited

Rebuttals and the case for Vue (then why still use React)
Simplicity
Vue built in directives are much easier to grok,
<p v-for="item in items" > Some info about {item.name} </p>
vs
items.map(item=> {
<p>Some JSX code about {item.name}</p>

Declarative UI
Vue uses the same conceptual components structure but IMHO the implementation of single-file-components where the [script], [template] and (scoped) CSS live together makes it much easier to understand and review.
I like React's passing down of functions to child components better than Vue's $emit to pass events back to parents, but once your app gets to a decent size and you are using app-wide state management it almost becomes irrelevant.

Enables Building Rich UI
A tie between React and Vue with the personal preference of having the HTML code separate in a template block in Vue rather than HTML(JSX) mixed in with the javascript logic

One-way Data Binding:
OWDB is fine, but a lot of the time you actually want TWDB and it is a PITA with React. Vue gives you the functionality out of the box with v-model.

Virtual DOM
V-Dom gets a lot of hate, but both systems use it and unless you have a massive app, users are not likely to see performance issues. the use of React.memo() can help, but I find the use of hooks (useCallback,useEffect,useContext) really hard to keep in my head all the time.

JSX
If you like HTML in your JS use React. If you would prefer to have JS in your HTML use Vue :)

Performance
For most apps performance is bragging rights. the differences between React, Vue, Angular, Svelte or any of the other modern frameworks in most environments is undetectable to the user.

Other Plus points for Vue
It is progressive. You don't even need to install it, you can call if from a CDN and you don't need a toolchain to bundle it up: you can hold all of your templates and components in a single file. There are some limitations if you do that but you can get up and running with Vue very quickly.
For me the Options API is easier to understand than the Composition API even though the latter gives you more flexibility.
Key packages such as Router, Animation and Flux pattern store (Vuex 3 or Pinia) are maintained by the core team. This means better compatabilty and less cognitive load as all applications are using the same external libraries.

The Case For React
Jobs, Jobs and Jobs. If you are a developer then there are more jobs in React than the other frameworks put together (I'm in the UK). If you are a hiring manager there are more React devs than the other frameworks put together.