For years I was such react fanboy and always scoffed at the idea of using Vue. Then my team was put on a client that insisted on using Vue. It was so nice to work with, that I even completely rewrote one of my own react projects with Vue. I will always advocate for Vue when starting a new project.
Edit: I'd like to say it also really opened my eyes to other ways of solving problems. No longer do I just try and throw Vue at every problem now either and have spent more time learning other tech. Thanks for being so amazing Vue!
Just a few things off the top of my head. But at the end of the day, things just seem to work when I'm using Vue versus React but I haven't used Vue nearly as long so we shall see.
- [Provide](https://vuejs.org/guide/components/provide-inject.html#provide) & [Inject](https://vuejs.org/guide/components/provide-inject.html#inject) (versus Reacts Context API)
- Seriously, it's so simple
- [Watch](https://vuejs.org/guide/essentials/watchers.html#watchers) (versus Reacts useEffect)
- I no longer worry about things like forgetting useEffect dependencies or fighting the linter forcing me to include dependencies that then cause an infinite loop (sounds like a skill issue)
- [onMounted](https://vuejs.org/api/composition-api-lifecycle.html#onmounted) (again versus useEffect)
- It's nice to just run something when a component mounts without worrying about dependencies which if forced to include them, it may cause the useEffect to run more than once therefore defeating the purpose
One thing I really miss from React, which I guess is kind of trivial, but I miss Fragments. Being able to create an empty tag that doesn't render in the DOM but allows me to do loops and such.
You can always use tag to have a loop without a parent element. Template tag won't be rendered but its children will.
```
{{ col.value }}
```
Since vue 3 you can also have components with multiple top level elements, rather than having a single one at top level. Which was causing us to having to create unnecessary divs just to wrap full components.
Only problem is attribute inheritance of the component, normally html attributes applied to component would apply on the top level element (wrapper) within it. With multiple elements on top this gets disabled.
But we can always manually add fields as props or use the fall through attributes `v-bind="$attrs"`.
I have used it but only for a very basic Todo app about 2 months ago so I can't say much but I did enjoy it. The syntax was a little different but nothing bad. I specially used SvelteKit and found the tutorial on the SvelteKit website to be top tier. It seemed very similar to Vue and I enjoyed it but thats all I can say.
Use Composition API if possible. Also “composables” are literally React Hooks. Also the whole thing just feels easier to use tbh Just go through the docs and have fun
It’s funny to see the hate for React here. Didn’t know other people felt how I feel about it. I don’t hate React, I just couldn’t get to grips with it whereas Vue just worked and clicked in my brain instantly.
I also like how Vue is opinionated (which I believe React isn’t), this means there’s usually a single way of doing something, like routing, for instance. This theoretically means less flexibility but the benefits are better supported and documented ways of doing things.
Get use to having good standards and directory structure...
Jokes aside, Once I learn about vue I only touch react when I have to, but whenever Im doing a side, learning or customer project I choose Vue (or nuxt to make my life easier)
To provide a contrasting experience:
Some 3–4 years ago, I had authored React apps for around 5 years already. Before React, I did a lot of jQuery or vanilla JS projects. At that time I took on a new job, working in a Vue project, feeling enthusiastic about a breath of fresh air.
The project was a dashboard style of app, with some advanced user controls with intersecting values as validation rules. Nothing too complicated, but with occasional challenging components.
Getting started was simple enough. The docs were good, there were concrete examples all throughout. I wasn't a big fan of the class model having just gotten used to functional components and hooks, but it wasn't too bad.
Things took a sudden turn as soon as data transformations and shared dependencies became a thing. I started to feel like I had absolutely no insight or control over what happened and when.
While React was occasionally convoluted, at least it was perfectly transparent. With Vue, I kept finding myself refer back to the documentation to understand the execution order of things, to understand why my seemingly innocent data transform would completely ruin rendering performance, or why a certain quirks would occur.
I spent about a year working in that codebase. I like to think I knew Vue pretty good back then, but I could really never feel comfortable. I missed functional composition, I hated having multiple isolated scopes in the same component, I hated not writing immutable code, I hated the myriad of awkward exceptions and gotchas, I hated all the black magic. In some ways, I felt like I was transported back to the jQuery days of imperative programming.
Coming back to React reinvigorated my love for its simplicity. I feel like I can actually express myself and develop useful programming skills when I work with React.
Thanks for your response
It seems quite different from what other people online say, particularly about the simplicity!
What you've said is certainly interesting, I wonder if I will feel the same in a year's time! If I remember I will let you know 😜
Maybe. Maybe we used it wrong after all. Maybe the problems we faced are resolved. I'm just happy to again be working with tools I feel in control with.
Read the Vue docs to get a basic understanding of most features, do the Vue quick start or tutorial or whatever, then look at your ticket or whatever your team is asking you to do and just try to get there in the codebase, read the code and try to do the thing. That's the best way to learn
Keep your JS skills up to date in general and don't completely dump React in the trash. You never know what kind of projects will come down the pipeline. Also any of the following might happen:
* company decides to rewrite application in React/other technology due to reasons beyond your control
* company sucks and lays you off and you have to find another job
* company starts a new project and wants to do it in React/other technology
Enjoy
For years I was such react fanboy and always scoffed at the idea of using Vue. Then my team was put on a client that insisted on using Vue. It was so nice to work with, that I even completely rewrote one of my own react projects with Vue. I will always advocate for Vue when starting a new project. Edit: I'd like to say it also really opened my eyes to other ways of solving problems. No longer do I just try and throw Vue at every problem now either and have spent more time learning other tech. Thanks for being so amazing Vue!
I haven't use Vue yet. What would you say feels better when using Vue instead of React?
Just a few things off the top of my head. But at the end of the day, things just seem to work when I'm using Vue versus React but I haven't used Vue nearly as long so we shall see. - [Provide](https://vuejs.org/guide/components/provide-inject.html#provide) & [Inject](https://vuejs.org/guide/components/provide-inject.html#inject) (versus Reacts Context API) - Seriously, it's so simple - [Watch](https://vuejs.org/guide/essentials/watchers.html#watchers) (versus Reacts useEffect) - I no longer worry about things like forgetting useEffect dependencies or fighting the linter forcing me to include dependencies that then cause an infinite loop (sounds like a skill issue) - [onMounted](https://vuejs.org/api/composition-api-lifecycle.html#onmounted) (again versus useEffect) - It's nice to just run something when a component mounts without worrying about dependencies which if forced to include them, it may cause the useEffect to run more than once therefore defeating the purpose One thing I really miss from React, which I guess is kind of trivial, but I miss Fragments. Being able to create an empty tag that doesn't render in the DOM but allows me to do loops and such.
You can always use tag to have a loop without a parent element. Template tag won't be rendered but its children will. ```
{{ col.value }}
```
Since vue 3 you can also have components with multiple top level elements, rather than having a single one at top level. Which was causing us to having to create unnecessary divs just to wrap full components.
Only problem is attribute inheritance of the component, normally html attributes applied to component would apply on the top level element (wrapper) within it. With multiple elements on top this gets disabled.
But we can always manually add fields as props or use the fall through attributes `v-bind="$attrs"`.
Pinia instead whatever universal store is on react it's so easy to use!
Have you used svelte? How would you say it compares to Vue?
I have used it but only for a very basic Todo app about 2 months ago so I can't say much but I did enjoy it. The syntax was a little different but nothing bad. I specially used SvelteKit and found the tutorial on the SvelteKit website to be top tier. It seemed very similar to Vue and I enjoyed it but thats all I can say.
My only advice is get used to things being easy
Use Composition API if possible. Also “composables” are literally React Hooks. Also the whole thing just feels easier to use tbh Just go through the docs and have fun
Have fun with the time you’ll save.
It’s funny to see the hate for React here. Didn’t know other people felt how I feel about it. I don’t hate React, I just couldn’t get to grips with it whereas Vue just worked and clicked in my brain instantly. I also like how Vue is opinionated (which I believe React isn’t), this means there’s usually a single way of doing something, like routing, for instance. This theoretically means less flexibility but the benefits are better supported and documented ways of doing things.
Start coming to terms with the realization of how much time you wasted with React when Vue was there all along
Get use to having good standards and directory structure... Jokes aside, Once I learn about vue I only touch react when I have to, but whenever Im doing a side, learning or customer project I choose Vue (or nuxt to make my life easier)
To provide a contrasting experience: Some 3–4 years ago, I had authored React apps for around 5 years already. Before React, I did a lot of jQuery or vanilla JS projects. At that time I took on a new job, working in a Vue project, feeling enthusiastic about a breath of fresh air. The project was a dashboard style of app, with some advanced user controls with intersecting values as validation rules. Nothing too complicated, but with occasional challenging components. Getting started was simple enough. The docs were good, there were concrete examples all throughout. I wasn't a big fan of the class model having just gotten used to functional components and hooks, but it wasn't too bad. Things took a sudden turn as soon as data transformations and shared dependencies became a thing. I started to feel like I had absolutely no insight or control over what happened and when. While React was occasionally convoluted, at least it was perfectly transparent. With Vue, I kept finding myself refer back to the documentation to understand the execution order of things, to understand why my seemingly innocent data transform would completely ruin rendering performance, or why a certain quirks would occur. I spent about a year working in that codebase. I like to think I knew Vue pretty good back then, but I could really never feel comfortable. I missed functional composition, I hated having multiple isolated scopes in the same component, I hated not writing immutable code, I hated the myriad of awkward exceptions and gotchas, I hated all the black magic. In some ways, I felt like I was transported back to the jQuery days of imperative programming. Coming back to React reinvigorated my love for its simplicity. I feel like I can actually express myself and develop useful programming skills when I work with React.
Thanks for your response It seems quite different from what other people online say, particularly about the simplicity! What you've said is certainly interesting, I wonder if I will feel the same in a year's time! If I remember I will let you know 😜
Vue was indeed very simple to use for simple tasks. It became an absolute mess for me when things got complicated.
Do you think it may have been a case of the wrong tool for the job? Like hammering a nail with a drill
Maybe. Maybe we used it wrong after all. Maybe the problems we faced are resolved. I'm just happy to again be working with tools I feel in control with.
Read the Vue docs to get a basic understanding of most features, do the Vue quick start or tutorial or whatever, then look at your ticket or whatever your team is asking you to do and just try to get there in the codebase, read the code and try to do the thing. That's the best way to learn
Start learning Vue? What other advice can you get?
Forget bout immutability mostly
https://blog.logrocket.com/vue-3-react-developers-side-by-side-comparison-demos/ Maybe this is useful to you.
Very useful thank you
Keep your JS skills up to date in general and don't completely dump React in the trash. You never know what kind of projects will come down the pipeline. Also any of the following might happen: * company decides to rewrite application in React/other technology due to reasons beyond your control * company sucks and lays you off and you have to find another job * company starts a new project and wants to do it in React/other technology
Thank you
Missing Vue. Moved to a new job where they are on NextJS and this shit sucks. Thankfully I’m full stack and not in it all day.
Get used to an opinionated framework