I've been working with Angular (From V4 to V9) for at least 1.5 years now and I've been enjoying every bit of it.
In this post I'll try to explain my reasons behind moving from Angular to React, and why I'll probably come back, in certain cases.
From routing to dependency injection, from TypeScript support to services, I worked in both big and small projects and always felt empowered by the awesome toolkit provided by Angular.
I had also a chance to look at state management via NgRx and NgXs and enjoyed them also.
I feel like I'm not an Angular expert, but I can surely bring a nice project from idea to deployment with confidence.
One day a call arrived and I decided to move.
I'll start a new job at a new office in January and had a chance to choose my front-end stack as I'll be responsible for creating and training a new team for some new big projects to be developed during the next year, and felt like I could give another framework a try as I saw 99% of what I could see in Angular and wanted to learn something different.
I had a look at Vue, as I've been working a little with it in 2018, but felt like, if I had to move, better do it for the most popular one, so I went for React.
P.S. I didn't decide to try React because it was simply the most popular, but because being such allows me to have a wider developer audience to get information and tools from. It's the first time for me as a team leader, so I felt having a little more help from the community could only help.
When I started studying Angular, coming from a vanilla JS - Vue.js background, I clearly felt overwhelmed by the steep learning curve everyone mentions when talking about this framework, and I needed ~3 months of studying in my free time to grab the fundamentals and start doing something good (P.S. Thank you Mosh Hamedani for your incredible course).
As someone who never looked at a single React snippet, I thought it could be equally hard to grasp and master this framework and started to feel a little doubtful about my decision.
But, nonetheless, I decided I could give it a try.
As soon as I started my new course on React (Thank you Mosh, again!) I realized the length was different (We are talking about ~75% length reduction in the course) and thought
Well, I guess I could give it a try, see what it's all about, and then decide if I want to move to React or stick with Angular
I started as everyone else did, I guess.
Reactivity in React, a simple counter, child components, props, prop drilling, class vs function component, state management, hooks, and.. stop.
Yes, you read that right, STOP! That's React.
Of course, I know React has thousands of features coming from official and unofficial libraries, routing systems, global state managers, GraphQL clients, etc., but nonetheless React is just that, and if you want to start with some simple stuff, that's all it takes.
As I was running like Flash through the course, I realized one thing: Every framework shares a fair 50-60% of fundamentals with every other, so if you grasp them in Angular, you can reuse the same mental model for React. So what's my answer? 3 hours.
Yes, I'm not joking, I just needed 3 hours to learn it. And wanna know the most incredible thing?
I don't wanna bother you with code snippets and long discussions about which one is better. Angular and React solve different problems in different ways. But, to provide an understandable example, everyone who has ever worked with Angular knows the intrinsic problem-solving power of services, so bringing them with me in React was an easy and powerful way to solve some of the problems I was facing in my sample apps.
Yes and no.
I feel really good when I work with React, as it's easy, fast, reactive and does everything I want it to do letting me understand every bit of what I'm doing, instead of the fog you have in Angular in certain situations (Of course, there are many world-class Angular experts here on dev.to, but that's not the case for 90+% of front-end developers who approach Angular on a daily basis and can't easily grasp the inner bits and parts of Dependency Injection and Lazy Routing, for example).
But at the same time, Angular solves different problems, hardly solvable by React without a good dose of patience and self-control, so I guess I'll use both, depending on the occasion.
We are reaching a point where front-end developers are not expected to know just vanilla js and a framework, but to grasp the fundamentals of the whole industry, and I guess having two frameworks in my toolkit could solve me many issues in the future.
If you follow me, you know I always ask people to comment and provide their opinions, so feel free to share yours and let's discuss them together!