DEV Community

Discussion on: React vs Vue: my personal point of view

Collapse
 
aisone profile image
Aaron Gong • Edited

I have used both in production on complex projects

React

1 infinite call to render if you do not handle re-render correctly

2 changes not rendered if you do not handle re-render correctly

3 unintended renders when parent updates

4 Not easy to debug / extend functionality of component/s of HOCs wrapped in many layers... e.g: populateTable(i18n(userFilter(getAuthGroup(getSomeData))

5 if a 3rd party HOC name clashes with another 3rd party HOC that you use... one will overwrite the other and you will get problems

Vue

1 directives (v-if, etc), but easy to get used to (some dislike directives as it seems like magic...)

2 slots are used instead of HOC, does not look as elegant as React.

3 this.abc below can cause problems...

props: ['abc'],
data () { return { abc: '' } }
methods: { abc () { } }

Own experience (your mileage may differ)

For the same project specs, I take half the time to complete using Vue because in React, I have to be more careful about direction of data flow, and re-render

This is because of the different way React and Vue updates the virtual DOM

In React when the parent updates, all the child and below updates unless you specify not to (in React Hooks, the [] in useEffect controls what gets updated)

In Vue reactivity in a component is specified in the "data" property

So far I have not seen the headaches of deeply nested React HOC wrapping in Vue, perhaps due to the way slot works

e.g. A has slot B, B has slot C... but C is not affected directly by A... Maybe because it is like this that makes it hard to run into problems...