Why Next.JS over Remix (as a react developer)

Created June 11, 2022

Developer Experience

One can easily overlook the developer experience when selecting tools as a senior developer for instance, because you know how to build an application with aws lambda, you could overlook the team's experience altogether and create a complex series of processes that makes it possible to teach and get teams up and running. I don't discuss the possible use cases of lambda or deny it's usefulness here but use it as an example.

Remix is as described on their website:

a full stack web framework that lets you focus on the user interface and work back through web standards to deliver a fast, slick, and resilient user experience.

Useful features of remix

Remix has some very useful functionalities that is just mind boggling, not only is it faster than Next.JS in general but it also has some neat features like nested routing which in itself is a game changer as compared to Next.JS routing. It allows you to do a lot more, like nesting actual pages (with it's own fetcher for data fetching) in a root page or a page like your dashboard for instance. You can fetch data in the root dashboard page, like dashboard.tsx and basically nest other routes like insights.tsx in the dashboard, allowing you to not only handle errors with your insights page independently but also get access to data from your main dashboard page in your insights page, mind blowing right?

Remix/Next.JS and developer experience

The learning curve of remix can be very steep, I find it not very friendly to beginners. Say, you have learnt react and want to move on to use a framework,

With Next.JS:

In general, as a react developer, when migrating to Next.JS, you don't need to learn a lot as compared to using remix.run. You can basically use all your react features and slowly opt into using features like server side loading, client side data loading. With migration to Remix, you need to learn these new hooks remix introduces, like useMatches, useFetchers, useSubmit and a whole lot more. This gives it a bad rep in terms of developer experience and beginner friendliness to react developers in my opinion. In the react ecosystem, one already has to keep up with a whole lot of hooks and even as senior developers, we sometimes use these hooks wrongly. React already comes with its own learning curve with hooks and how it works and I think Remix introduces another complexity with a whole new mindset that developers have to adopt and learn.

As a senior developer, one might appreciate it for its PHP like nature and whatever nostalgic memories it brings to you because of how easy it helps you to write code. But as a react developer or a beginner it only increases the complexity of learning and using react to develop applications with new complexities to understand and use.

I think Remix introduces a whole new tooling that takes you to the next level but as a developer, it only increases the complexity of what you are already used to in react as you have to adopt a new mindset and learn new hooks in addition to your confusion already with useRef and forwardRef. We are constantly learning to use react and I think a framework that builds on top of it should make it easier to migrate from react and still keep doing what you were used to. One could argue that just like Next.JS one could slowly opt into the features of remix but that would be an understatement as it would be a bad use of the tool because remix was purposely made because of those tools.