Ask HN: Learn React or Vue?

14 points by pottertheotter ↗ HN
Which front-end framework would you learn: React or Vue?

[Edit: should have clarified, but I'm a solo entrepreneur. But eventually plan to hire others to mainly take over the dev work.]

I have some past experience with Vue (specifically Vue 2), but it's been a while and I've forgotten most of it. Considering Vue 3 is out and quite different, it feels almost like starting from scratch.

My initial choice of Vue was based on its ease of use for beginners, as recommended by a friend. I found it approachable, but now I'm reconsidering my options.

Here's why I'm contemplating React:

- It seems to have a much wider usage in the industry.

- There's a larger ecosystem of tools and resources available for React.

- It might be easier to find and hire people skilled in it.

- I've noticed specific tools and resources, like the low-code tool Recode and Tailwind UI templates, predominantly use React.

Given these points, I'm leaning towards React despite my prior experience with Vue. I'm looking for insights from the HN community. Which framework would you recommend for someone in my position? Any advice or personal experiences would be greatly appreciated.

45 comments

[ 6.1 ms ] story [ 96.8 ms ] thread
They're both fine but the larger React community makes it more interesting to me. More online support, more libraries, more jobs, etc.
You could learn both and also Svelte if you feel like it, and then use react.
I have experience with both, but will always opt for Svelte if I had the choice. In practice your employer will likely make you use React anyway if you code professionaly
I think the answer is unique to your situation. I've seen and read many experiences of those who have both used React and Vue (including myself), and many prefer Vue. That said, because React is more popular, this is going to get your foot in the door in many more companies, and it's a bit of a "well everyone is using React so we will too" type of spiral.

For me, if I were trying to get hired, I would choose React. If I were looking for my own side project or in a position where I got to choose, I would choose Vue.

I'd learn both, or at least start to, and find the one you like best.

I don't get the point of learning something you don't enjoy working with.

It really depends for whom you are doing the coding. If you're a corporate contractor or wish to work as a developer in the corporate world you will have an easier time learning React because as you stated it is far more common.

If you're building a startup go with Vue if it allows you to get up and running faster. Use React if it gives your project a distinct advantage because of a library you can access that gives you a specific advantage over your competition and gets you to market quicker.

For the record I am a Vue/Nuxt developer but in my case its because I am a solo entrepreneur and I find it easier to just get stuff done.

I appreciate the response. I should have clarified; I'm a solo entrepreneur, and eventually plan to hire others to mainly take over the dev work.
Vue 3 follows a similar approach to Vue 2 (reactivity on objects, translates automatically to DOM updates). Although there have been some syntactic changes (such as the composition API).

Job-wise React is probably the better option, in terms of number of job offers you might get.

Vue’s smaller ecosystem has not proven to be difficult in practice. I think we could benefit form importing less dependencies in our projects anyway :)

React seems hard to use, ever-changing and generally not a good option on a technical level. I haven’t used it professionally but that’s the impression it’s given me

I chose React because it really made life much easier when it came to reusing components and organising my projects. I find bare bones React the right level of complexity for me and I can get a lot done with it
React. Its way easier to hire for. It has a much larger support community and tool ecosystem.

Vue was great until the v3 rewrite where they tried to copy react hooks.

Asking "why" or "which" questions should always start with the end goal in mind.

Isn't it obvious?

In my view they both can suck and shine depending on the application.

Vue has enough job opportunities. Is also more fun work with than React. Vue 3 with script setup is much easier and efficient than React.
My recommendation would be to first learn vanilla Javascript. Become experience in it (I'm assuming you're not a Javascript expert yet). Build a couple of websites with vanilla Javascript. Then, move to a framework. First, it's much easier to learn these frameworks when your foundations are strong. Secondly, you'll better understand how the framework works under the hood. Thirdly, you understand better why a framework is used, and what it tries to solve what vanilla Javascript cannot (easily) do.

p.s. You'll be surprised how far you can get building a website with vanilla Javascript without the use of any advanced framework.

I find React easier to reason about, which is a big advantage for me.

I had this argument with people a few times, and I always used to say "I could imagine writing a rudimentary version of React myself, without seeing their source code. I couldn't imagine that for Vue".

One day I decided to put my money where my mouth is, and did it. Only about 400 lines of code with all the main hooks. I'd share it here, but more to the point I'd encourage others to try it themselves instead - the code isn't the point.

From the POV of a former Vue 2 user: I just migrated a small-ish project from Vue 2/JavaScript/PHP to Vue 3/TypeScript/serverless after a couple of years of not touching it, and the process was straightforward.

Vue's docs are excellent, and I used GPT-4/Phind/Copilot (I wanted to try different solutions) when I got confused. I chose not to rewrite stuff to use the new Composition API (which is apparently analogous to React hooks) for now. I did change the build system to Vite, which is awesome, and which you can also use with React.

I don't have anything against React, except that it seems very complex and is missing basic (to Vue) functionality, the most notable being Single-File Components (which I'd miss terribly). https://vuejs.org/guide/scaling-up/sfc.html

I've built projects using React, Vue, and Svelte in the last year. All 3 are great in their own lane. React is a great starting point for larger teams to add on things to and it does start to be come its own beast within large teams.

For Vue, I think it's in the middle for me, it can be used by teams and can be used by solo devs and it seems to follow some very good practices. This I would take away from React only for the reason that each major version introduces some new concept that flips things on its head and I have feel like each new react project doesn't feel like an older one I worked on 2-3 years ago, and in some cases, not for the better.

Regarding Svelte, I wish I used it more. I built a project [1] that took me almost no time except fiddling around with github actions to get it up and running and it felt so naturally close to html/js when building, I was hardly looking up documentation or tutorials. Adding new features to it felt even more fun.

I've mainly stuck with React because of the large ecosystem but in 2024, it feels like once you find a good starting point with any of these, you should be able to build most apps with it.

Another thing to not shy away from is seeing that most large projects use React as an example, you can use something like ChatGPT to convert a react snippet to a vue or svelte snippet.

1: https://bikes.usmanity.com

>This I would take away from React only for the reason that each major version introduces some new concept that flips things on its head

I don't think that's fair. The switch from classes to functions+hooks was a significant one. Besides from that I have never felt like the React team pushed anything on me, and even that was optional, class components still work. Now, the way I write React has certainly evolved but that applies to all my code..

> I don't think that's fair

Fair or not, it's a prevalent enough notion to have it's own term: React fatigue.

If you're only learning for a job, React. Or at least check job postings in your area and see how it looks like. If all of them are React, then why learn Vue?

But I honestly don't think it's that important.

As others have noted, it depends on what you’re looking for. But it kind of sounds like you’re starting something new / anticipating hiring more developers. If this is the case, I’d suggest getting really honest about your needs and whether they point to a front-end framework at all. Recognize the significant cost the SPA architecture imposes. It’s worthwhile at times. But more often than not, in my experience, it’s a wholly unnecessary expense.

Check out some alternative non-SPA style frameworks like htmx, or Hotwire. You could save yourself a lot of work if these tools are sufficient for your app’s needs.

It depends on why you need to learn a framework.

If this is for your own projects, especially since you have some past experience with Vue 2, stick to Vue. It's simpler, the documentation is excellent, the community is great, and I found it to be more stable, fun and productive than React.

If the intent is to find a job, learn React. Even though if you have experience with a framework, you can easily pick up another one later.

> My initial choice of Vue was based on its ease of use for beginners

Yes, that is no longer true. It is as complicated as it gets. Moreover, they killed a whole ecosystem while making the transition from 2 to 3. Go with React, I regret not doing that myself.

If it's your first framework, it doesn't matter which one because you have to learn how to learn first. If it isn't, learn both and I would add Svelte and Angular.
Are you looking to get a job with your framework of choice? Or are you looking to build stuff for yourself?

If it's the former: React

If it's the latter: Svelte (Especially with Svelte 5 around the corner)

I appreciate the response. I should have clarified; I'm a solo entrepreneur, and eventually plan to hire others to mainly take over the dev work. So mostly the latter.
Both and Svelte.
You should try both and use the one that makes you happy.

Both are good, both are widely used.

Assuming an entry level job?

Probably React. But real world code (in the form of libraries/apps/projects) is way more valuable IMO. Regardless of framework, to an extent of course. Good luck!

I appreciate the response. I should have clarified; I'm a solo entrepreneur, and eventually plan to hire others to mainly take over the dev work.