5 ms·
I moved to Vue from ~3 years of React. I've now done ~2 years of VueJS while continuing to use React in some side projects. To be quite honest, I'd probably st
by Rodeoclash 5y ago
I moved to Vue from ~3 years of React. I've now done ~2 years of VueJS while continuing to use React in some side projects.
To be quite honest, I'd probably stick with React if given the choice. My takeaway with Vue is it makes a number of choices for you out of the gate w.r.t to things like data store (Vuex) and routing (Vue-router) whereas with React you'd bolt these on yourself (i.e. mobx and found-router).
I also feel like Vue gives you many more opportunities to shoot yourself in the foot in weird and wonderful ways. For example, you can access the instance of a parent or child component without too much trouble whereas React does seem to go out of its way to prevent this.
React has a few quality of life improvements too, things like hooks (which may be in Vue now? Not sure) and being able to have components with multiple children at the root.
- CodesInChaos 5y agoIf you've only worked with vue2, I'd give vue3 a look. I like the new composition API a lot. > you can access the instance of a parent or child component without too much trouble $children was removed in vue3 https://v3.vuejs.org/guide/migration/children.html https://v3.vuejs.org/guide/migration/children.html > things like hooks Vue doesn't have react style hooks, but the composition API fills a similar niche. > being able to have components with multiple children at the root. Vue3 seems to support this: https://v3.vuejs.org/guide/migration/fragments.html https://v3.vuejs.org/guide/migration/fragments.html
- preommr 5y agoFunnily enough the reasons you gave are the reasons I like vue and dislike React. I like de facto solutions instead of half-baked libraries that might have slight incompatability issues. I also like the freedom and flexibility that vue offers rather than the weird guardrails that come with react.
- ibdf 5y agoThe CLI literally gives you the option to add vuex and vuerouter but it doesn’t force you to. You can use whatever you want or not use these options at all. You can access the instance of parent or child but it also recommends you to use props and emits so that you don’t shoot yourself in the foot.
- kiawe_fire 5y agoI work about 80-90% with Vue 2 and 10-20% with React, so take this with salt. But, with React, I rarely find myself wondering why the component isn’t re-rendering when something changes, whereas this happens frequently with Vue. I also rarely find myself having to plan out how props will flow to state or when something needs to be a computed (or memoized) property. Things usually just kind of come together. There are several reasons for this, but often times it comes down to either doing the wrong type of assignment that makes Vue lose its wrapper object around the property, or something to do with the way I use props as defaults for reactive state. Which leads to another complaint - mixing props passed in to the component in the same space as the reactive state. This means the property needs a different name from the state property that it drives, it means having to mentally track which piece of data can be mutated because its state and which cannot because its a prop, and it often means wondering why your component isn’t re-rendering when your prop changes, only to finally realize you really need a computed prop or a prop watcher. I don’t want to sound overly dramatic though. It doesn’t happen every day, it’s never prevented me from doing anything, and Vue (IMO) makes up for it in other ways like single file components with better styling options. It’s also possible I just haven’t used React enough. But that said, in my experience, some of Vue’s magic that makes it simpler to get started with, is also what makes it trickier to work with as projects get larger. Disclaimer: Vue 3 introduces hook like things that I haven’t tried, and perhaps make my complaints less valid.
- stevage 5y agoI, similarly, work about 90% with Vue2 and 10% with React. I have a different experience though. I generally find React pretty mysterious, with very confusingly named methods, and several generations of approaches that are completely different from each other. (React Hooks changes everything...) I used to occasionally find situations in Vue where something wouldn't re-render, but that almost never happens anymore. The main culprits are when a component never gets mounted (because it's in a v-if), or expecting reactivity before it gets mounted. I hate the clumsiness of React, the lack of "methods" and simple event handlers, the need to be overly verbose everywhere. I almost never use Vuex, fwiw. I find both Redux and Vuex (which apes it) are an incredibly complicated solution to the problem, and wish there was something simpler.