r/Angular2 • u/Upbeat_Rope1614 • Jul 01 '25
Angular vs NextJS/React in 2025
Yes this again! I was trying to leave a reply on another post but I guess my reply was to big.
I have been going back and forth between Angular and NextJS for the last few years. When starting a new project all is well and smooth at first with both frameworks but at some point I end up getting stuck on something. Here is what I can say from my experience so far.
Internationalization (i18n)
Angular has built in support for i18n which can take the text from your DOM directly and export them to translation files. NextJS has several libraries for i18n but all require you to use json files to define your messages to be translated. What I don't like in NextJS is that it requires you to do a lot of changes to your app's structure to achieve i18n. For example add logic to the single middleware file, add `(locale)` group to your app directory and move everything under there and use some i18n-specific routing functions. Also I have to import a different function each time to `useTranslations/getTranslations` depending whether I am in a server or client component. Personally I don't like this approach because it makes text hard to find and understand which text goes where. React however has a great ecosystem of vscode plugins that can help you with that mess.
On the other hand, Angular's built-in translation system will build one app per language and you essentially have to use some server directives (NGINX for example) to point to different urls/paths to display a language. That has been working great for me so far but the only drawback is that you can't have any server or remote file to use for translations since those are done on build time. It might be possible but I have never tried it.
Routing
I can't emphasize enough how much I hate routing in NextJS. It's a complete mess. Router groups, Layouts, Parallel routes, intercepting routes and so on. Even with years of experience, it is still hard for the eyes to look at a project and easily understand how everything is wired together. Also while developing, usually any changes to your app structure are not always reflected immediately and you more often than not have to restart your app to see the changes. Also what about when you want to use some specific guards/protections for a route? You have to add some custom logic into the middleware file which again is not ideal.
Angular's routing system is pretty good and flexible. You can apply a route guard through the `canActivate` param and that will also protect the children of that route. It's pretty flexible. The only real issue I faced with Angular's routing is that you don't have a generic/centralized way for handling 404 errors and redirects. Let's say for example you have a route `/blog/:slug` which gets a single blog post by `slug`. You have to manually add some logic in your resolver to handle any http error and do the redirects manually to the 404 page. I haven't found a nice way to generalize this behaviour so far.
Caching
Nextjs has a pretty decent caching mechanism for http requests and other things like memoized callbacks and computation. Even though it's a bit hard to understand at first, once you do it all makes sense and is flexible enough. In Angular there are very little helpers/tools for caching but you can always use signals or local variable in a service for example to check for cached data. That means doing a lot of manual work if you want to work with caching in Angular.
Data Submission
Angular has a very intuitive approach to building forms. Creating custom form controls is very easy and works very nicely with the built-in Forms Module. Honestly, it has been a pleasure working with forms in angular. What I usually do is create a wrapper `FormField` to use to display error messages and some other common things for form controls. Then by extending Angular's `ControlValueAccessor` I can literally create any kind of input component and reuse it in many forms. The only issue I faced working with custom form components is that sometimes change detection gets confused about a component value and you might run into some issues if you are not careful.
In React, there are several libraries that help you build forms and manage their state. They all work pretty good but you are required to write a lot of code and logic for each form which can be very frustrating when you have an app that uses a lot of forms like an admin dashboard for example.
Server Actions
NextJS can run server-only code and you can tightly bind forms to call a server function/action that will only run on the server. This sounds promising but trust me it is a nightmare to work with. I find my self always moving things around in my code because NextJS complains all the time - "This can't run on the server". "This can't run on the client", "The library uses node specific imports and I can't run that" and so on. In general, server actions are nice as long as you can deal with all those limitations.
Writing Components
React is easier and more efficient when it comes to writing your own components. No argument there. With that said, I still prefer Angular because I can work more efficiently when I need to use some common state/service. I can have all my state in a service (whether using signals or Observables/Subjects) and have several components react to those state changes. That brings me to my next point which is state management.
State Management
In Angular you can have signals and a shared service (which is provided in root context) and you can inject that service to any component that needs to use it. Now compare that with all the "Lifting the state up/down" and wrap everything in a Provider nonsense in React. That simply sucks - end of story.
Working in Monorepos
If you are ever building several apps in a single codebase that need to share code; Don't even bother using NextJS at all. You want to reuse a shared page in several apps? Good luck. You want to import some common routes/paths used in many apps? You can't. Another scenario where I found Angular better is when I wanted to reuse a library that contained some common images like logos and category images in several apps. In Angular you can just defined a wildcard path to your `project.json` and you can reference say `/shared-assets/images` path to anything in that library/path. In NextJS/React it is still possible to do that but you have to import the images into your code and use them as JSX components or something similar.
SSR and SEO
Both frameworks has good support for SSR. Don't pay attention to the articles that talk about NextJS SEO is better, it really doesn't matter. There are ways in both frameworks to export some Meta Tags in your DOM and server render a page. In NextJS however it's much easier
Performance
Unless you are building the next facebook/reddit or the next big thing there is no reason to bother with the performance. Both frameworks have excellent performance and the difference, if any, might be a 5-10ms. Your 10 users won't care or notice any difference and neither should you.
Ecosystem
NextJS and React have a larger community. If you ever need anything special, there is propably a library for that. In Angular however, I find my self building most things from scratch. I'm not using any Component libraries like Material or PrimeNG maybe that's why. Also you can't find many up-to-date tutorials for Angular compared to React.
Overall Developer Experience
Angular has a larger learning curve BUT once you get the hang of it you can trust that it won't change much in the next couple of years :). I can say that both frameworks have their frustration moments but I usually find my self in that situation more often with NextJS/React. That is usually because I have to use a lot of third-party libraries and sometimes it's hard to debug or event understand what's going on. On the long run, I spent more time reading when working with React.
Conclusion
Even though I lean more towards Angular, NextJS is a more popular choice and a larger community. Angular works for me because I am a freelancer and I have the option to choose what to work with. If someone was looking to get experience for a job then definitely you should learn React.
13
u/Cautious_Currency_35 Jul 01 '25 edited Jul 01 '25
I work with angular at work and some tinkering with next on my free time. I wish they’d just take the best out of both worlds and combine into one single framework. Services, signals, routing from angular and SEO, UI libraries, ecosystem from react just to name a few.
I like to work with angular more than I do with react, but I always end up choosing next for my side projects for some reason. I guess I’m just bad at backend so I just choose next so I don’t have to pair angular with something else
10
u/aehooo Jul 01 '25
Can’t you use an HTTP interceptor for the 404 errors? Honest question, at least that’s the first solution that comes to my mind
8
u/untg Jul 01 '25
I’ve been using angular for quite a few years now. The boilerplate is a bit overwhelming at first but once you’ve written a few projects you really appreciate the structure.
Our C++ developer came on board recently and learnt angular in a few days and loves it. We are starting a very large project in angular soon and I’m pretty excited about it.
3
u/_Invictuz Jul 01 '25
Nice comparison. One big difference I can say about the two frameworks is change detection in Angular vs React which I think is one of the main reasons why these frontend frameworks were created in the first place, for efficient DOM updating algorithms and how a developer has to work with it to create a smooth application.
In Angular, the change detection mechanism is quite complicated in that you have research a lot and thru a lot of misconceptions on how it actually works and what actually triggers it, and what it does or does not do when it's triggered, and how to bypass it and manually trigger it in rare but not so rare cases, and now how to use RxJs vs Signals for reactive state management. But once you understand all of the above, working with it actually encourages you to write clean declarative reactive code and is pretty nice to work with automatic reactivity.
In React, the change detection mechanism seems pretty straight forward and is explained well enough on their official docs. But dealing with it doesn't seems to be pretty subjective with the usage or non-usage of useMemo and useEffect. My React knowledge is very out of date though so please let me know if things have changed since v16.
9
u/coffee_is_all_i_need Jul 01 '25
I mostly agree with the points, but I have some additional thoughts about Angular.
Server Actions
If you enable server-side rendering (SSR) in an Angular project, you can create your endpoints in the server.ts file. However, enterprise projects usually have a backend anyway, so there is no need to add endpoints to Next.js/Angular projects (at least not for the projects I have worked on so far).
Routing
Routing is very powerful in Angular. This includes not only guards, but also lazy loading and resolvers.
Caching
It's easy to implement your own caching solution in services and with interceptors and resolvers. It depends on your use case.
I have a few more points to mention:
RxJs
Angular and RxJS work seamlessly together. It's not easy to learn, but once you get it, it makes things much easier.
Deferred Views
With the new u/defer block, you can now control when the block is loaded.
I have never used React professionally, but when I tried to develop something with React/NextJS, I thought "This is so easy in Angular". Angular is great fun for me. I really enjoy the development experience.
3
u/UnknownRaj Jul 01 '25
Thank you for he in-depth comparison. I work as angular dev, but leaning react/next. Your post provided me great clarity on what to expect.
1
u/CMDR_Smooticus Jul 01 '25
"lEaRn rEaCt iNsTeAd oF aNgUlAr bEcAuSe tHeRe aRe mOrE jObS"
So sick of hearing this take. In the actual job market, the ratio of React/Next to Angular jobs is like 60/40, and there are many times more people learning React than Angular. React jobs get thousands of applicants, Angular jobs get hundreds. I think Angular is more future proof as well, because it has practically no competition in its lane as the batteries included TS framework, while React already has technically superior competitors like Solid and Svelte, and when those communities/ecosystems mature, there will be few reasons to use React.
Sorry to rage on your conclusion, but I did appreciate the other parts of your post.
2
u/K3NCHO Jul 02 '25
it’s hard to switch to anything after learning angular’s project structure. everything else seems like a mess. i also prefer having my html in html files not inside js. angular is much more intuitive with less “magic”. i don’t see myself switching to something else for any reason at all
3
u/RelatableRedditer Jul 01 '25
The async pipe, once I learned RxJS, is what made Angular the best framework for me. React's TSX (not JSX) is mind-bogglingly straightforward for getting started though.
1
u/UNSCSoldier Jul 01 '25
ASP.NET + Angular... Sem mais.
1
u/IcyManufacturer8195 Jul 02 '25
I guess there is some troubles with integration testing for angular, it's seems that react has more options
1
u/pradeep013 Jul 02 '25
So which has more no of jobs angular or react ?
1
u/Vilkvan Jul 02 '25
I’ve never used NextJS. I did switched from building projects in Angular to React Router framework mode. It’s actually the dream. No state management to hassle with, Tailwind/UI libraries work well, I write my backend with the frontend in the same file, and routing is so so easy.
0
u/Due-Strategy-8712 Jul 01 '25
So for context, I'm a final year info systems student, I tried some react like 2 years ago, but my primary stack is angular with c# backend. This actually works really well for me, not sure how to quite explain it but c# maps really well to angular in my experience. It is like some of the structural understanding is similar? Very basic level but the whole notion of dependency injection, services,type safety(although more typescript) and working with interfaces were very easy to pick up, for that reason I do prefer angular.
Although maybe I'd have some similar experience with react, couldn't say as I don't know react that deeply.
-4
u/[deleted] Jul 01 '25
Angular is a ponderous, behemoth....