DEV Community

loading...

Discussion on: Vue over React just for the syntaxis? :(

Collapse
manuelmartindev profile image
ManuelMartinDev

One thing I really like about Vue is the State Management, Vuex is a lot easier to understand than something like Redux in React, I also like the scoped styles, even so I use React , because it works, I'm comfortable with it and it gives me what I need so I didn't see the necessity of change, but it is true that the developers including me are like a kid with a new toy when a new framework shows up, so I think Vue is kind of trendy now, I have planned to do some day soon the exact same project with React and Vue, at the end of the day what matters is that the Framework make our life easier, if it does is good

Collapse
cyberhck profile image
Nishchal Gautam

Vuex is the reason I hated vue, you have mutation, when you call, you pass its name, I hate string being passed, when you like typed languages, you prefer typescript, and vuex using string was it for me.

With redux, 100% of my code is typed and checked on build time.

Collapse
vonheikemen profile image
Heiker

I'm going to leave this right here just in case someone finds it useful:
Mutations - Object-Style Commit

Thread Thread
cyberhck profile image
Nishchal Gautam

You didn't understand what I meant, of course, it's not that, did you notice inside the object, there's a field called "type", the value for which is a string "increment" it's the name of the method inside your mutation, that's my point.

Thread Thread
vonheikemen profile image
Heiker

Interesting.

As far as I know redux uses a similar convention. When you call dispatch you must pass an object with a type property. That type property doesn't have to be a string but it is strongly recommended that you make it a string. Why would it be such an inconvenience in vuex? Is it really because they are methods?

Thread Thread
cyberhck profile image
Nishchal Gautam • Edited

What happens when you call a mutation which doesn't exists? With redux it's that way because by default you return current state, and if I'm writing with typescript, I can even get typescript on those stringy values (just need to write types correctly). With vuex, if they had something like: commit(mutation.increment) that'd be much better.

That's the biggest reason I switched back from vue to react, close but second biggest reason is lack of similar level of typescript support. Because of templates, for some reason vue has less typescript coverage (similar to angular)

You can compare all 3 projects, even though react internally isn't written in typescript (yet), it has the best typescript support.