How to Conceptualize Remix vs React

Introduction
When learning a new skill, especially software engineering skills, I like to read the manual first, assuming there is a manual. When I was first learning JavaScript. I read JavaScript: The Definitive Guide cover to cover in a weekend. Sure, I've forgotten quite a bit of the minutiae, but that's not the point. I saved my future self hours of wasted googling and searching for fixes because of silly misunderstandings of JavaScript's semantics and increased the velocity with which I could dive into and understand existing code bases from one weekend's worth of effort.
Some people like to dive in and start coding or using the skill. As a dev, you get so used to JIT (just-in-time) learning of new skills that it's easy to fall out of the habit of thoroughly reading the documentation---just search it as you need it, right? Wrong.
This is anti-"Ops" mindset is taboo to me. Why? Because the "Ops" mindset is about smartly investing your time and energy in the present to reap huge dividends in the future. If you're learning a new engineering skill, it's presumably something you're going, or hope, to use on a regular basis for a long-time. Do yourself a favor and invest some time reading the documentation. I can't tell you how many colleagues I've helped debug things throughout my career who would have saved themselves hours of time and frustration had they just spent a few hours reading the documentation. Also, research shows the heuristics programmers rely on for JIT learning can lead us astray when, for example, learning a new language.
I digress. As the title indicates, the point of this article isn't a diatribe against JIT learning. The above is my long-winded way of motivating this article. In the course of learning Remix, the first thing I did was start reading the documentation. My primary goal was not just to glean the API, but develop a solid understanding of Remix's semantic model and how it related to frameworks I was already familiar with. Given Remix is built on top of React and it's the framework I've invested the most in recently, it's a natural point of comparison.
Comparisons with other frameworks like Svelte or NextJS would also be interesting, but are out of scope. If you come from a different framework and want to contribute your thoughts, drop a comment!
Model View Controller Pattern
Before we get into React and Remix's Semantic models (in that order), I first want to briefly introduce the Model View Controller (MVC) pattern since I'll use it as a point of reference throughout this article. If you're already well-versed in this, just skip to the next section.
What is the MVC pattern?
React is not considered to follow a Model-View-Controller (MVC) pattern. Nor does Remix follow a pure MVC pattern. Some people argue React is like a vertical slice of the the MVC pattern. I adhere to this view as you'll see in my diagrams below. Nonetheless, I find it useful for conceptual purposes to map React's Flux pattern back to the MVC pattern because it is so ubiquitous. (See here for a nice analysis of the differences between flux and MVC.) Many full-stack devs cut their teeth in the era where MVC was the pattern. Even newer devs probably have some notion of the MVC pattern.
React
React is purely client-side and is typically built and deployed as a static site. This means your React application, once built, consists of static assets that are served by any web server or content delivery network (CDN). These static assets primarily include HTML, JavaScript, and CSS. One of React's most significant strengths is how it decouples from the server, enabling seamless updates and interactions purely within the client's browser. The server primarily deals with providing data, while React dynamically updates the user interface based on that data.
When developing in React, you encounter a plethora of libraries designed to help you virtualize or replicate the MVC stack client-side. React alone only gets you so far. Admittedly, this is not the only way to use React. But it's quite pervasive in my experience for projects of any significant scope.
React's Semantic Model

To understand how React virtualizes components of the classic MVC pattern, it's essential to see how it maps server-side Controller and Model functionalities to client-side equivalents. In a traditional server-side MVC pattern, the Controller processes requests and retrieves data from the Model. React's ecosystem achieves a similar structure, but all within the client-side environment.
- View/UI: React itself provides the "View" layer, responsible for rendering the UI elements. It efficiently updates the DOM when the state changes, ensuring a high-performance user interface.
- Controller/Dispatch: React components can act as controllers that manage interactions and state updates. Primitives like hooks and libraries such as RTK Query or React Query provide a way to manage and dispatch state changes centrally, mirroring the control logic in a typical server-side controller.
- Model/Store: State management libraries such as Redux, Zustand, Recoil, or even the Context API can serve as the "Model," storing the application's state. They function similarly to a database in an MVC pattern, albeit in memory and within the client.
The interaction between these layers follows a unidirectional data flow, a core principle of the Flux architecture upon which React was built. When a user interacts with the UI, an action is dispatched to change the state. The store then updates the state, and React re-renders the UI based on this new state.
This architectural approach ensures predictability and ease of debugging, especially in larger applications. Although Flux, explicitly juxtaposes itself with the MVC model, one can see MVC's fingerprints in the Flux control loop. The ecosystem around React, including tools like Redux Toolkit or RTK Query for efficient data fetching, further enmeshes MVC-like patterns into React, in my opinion.
Remix
Unlike React, remix does not require you to virtualize the MVC slice on the client-side. Remix natively lives server-side but extends to the client if needed. Put differently, remix's center of gravity is server-side but it is client-facing. What do I mean by that?
To quote Remix's own description of it's server framework:
Instead of having a split between View and Controller, Remix Route modules take on both responsibilities.
Most server-side frameworks are "model focused". A controller manages multiple URLs for a single model.
Remix is UI focused.
....
If you're not familiar with traditional back-end web frameworks, you can think of Remix routes as React components that are already their own API route and already know how to load and submit data to themselves on the server.
If you come from other SSR stacks, like NextJS, this should feel familiar.
Remix's Semantic Model
Remix fundamentally changes the way data flows by collapsing the traditional split of server and client responsibilities into a cohesive unit. Data flow in Remix is designed to be straightforward and efficient. When a request is made, the server controls the flow by executing data loading functions, often specified within the route modules. These modules can fetch data directly from the database or any other data source needed by the route.
Once the data is fetched, the server-rendered View is constructed and sent as a fully formed HTML document to the client. This process ensures that the initial load is both fast and SEO-friendly, since it consists of server-rendered HTML. When the client receives this HTML, it also hydrates any interactive components using React, transitioning seamlessly into a client-side application.

The magic lies in how the code is organized and built. In Remix, server-side and client-side logic can be written within the same files. However, during the build process, Remix's compiler smartly separates the server-specific code from the client-specific code. This allows for code sharing and reduces the boilerplate often seen in other frameworks that deal with both server and client logic.
Data fetching in Remix is elegant and tightly integrated into its route structure. Each route can specify a data loader function, which Remix invokes to gather the necessary data before the route is rendered. This loader runs on the server-side and ensures that the data is available when the HTML is generated, minimizing the need for excessive client-side data fetching and reducing the overall latency for the user.
Server-Side Native with Client-Side JavaScript
Indeed, Remix can function purely as a server-side framework and will work without any JavaScript. As a result, it gives us a lot of the performance benefits that draw folks to frameworks like NextJS. However, it bridges the client-server boundary and provides the option to add client-side JavaScript logic to your server-side view to achieve those nice UI/UX features we've come to take for granted due to frameworks like React.
Yet, having worked in NextJS, remix feels more intuitive with less sharp-edges. This may be a premature conclusion. We'll see.
The neat thing is that Remix lets the developer define all this logic in a single place and it handles the natural segregation of responsibilities between the server-side view and the client-side JavaScript. What does this look like in practice? Take the following example right from Remix's documents:
export default function Projects() {
const projects = useLoaderData<typeof loader>();
const actionData = useActionData<typeof action>();
const { state } = useNavigation();
const busy = state === "submitting";
const inputRef = React.useRef();
React.useEffect(() => {
if (actionData.errors) {
inputRef.current.focus();
}
}, [actionData]);
return (
<div>
{projects.map((project) => (
<Link key={project.slug} to={project.slug}>
{project.title}
</Link>
))}
<Form method="post">
<input ref={inputRef} name="title" />
<button type="submit" disabled={busy}>
{busy ? "Creating..." : "Create New Project"}
</button>
</Form>
{actionData?.errors ? (
<FadeIn>
<ErrorMessages errors={actionData.errors} />
</FadeIn>
) : null}
<Outlet />
</div>
);
}
The useEffect hook to focus the form, the error messages, and the button updates on submit are all handled client-side even though this component is built by and delivered from the server.
Remix feels like the natural next step in the evolution of web frameworks, moving as many things back to the server as possible, while adding back in the quality of life features from react (JavaScript) we've grown used to, and doing this all in a unified fashion.
Web Fetch API Handler and Server Adapters
A notable aspect of Remix's architecture is its reliance on the Web Fetch API as the primary interface for handling network requests. The Fetch API handler in Remix acts as the gateway for all incoming HTTP requests. It leverages the native Fetch API's to achieve alignment with modern web standards. This approach provides a consistent and familiar way for developers to interact with network resources, making it easier to reason about and manage data fetching and manipulation.
To me, this is one of the major draws of Remix: it's opinionated in the right places. Rather than forcing you to glue together your own data fetching system with a query library and specific state store, it provides phenomenal data fetching primitives and makes them first class citizens in the framework. All in all, it reduces cognitive load, freeing me to focus on writing business logic.
The Fetch API handler not only simplifies the process of retrieving data, but also enables better integration with various server adapters. These adapters allow Remix to run on different server environments seamlessly. Whether you're deploying on Vercel, Netlify, Architect, Cloudflare Workers, Deno Deploy, or your own server, Remix can adapt to these environments by only changing a few lines of code and config parameters.
Conclusion
In React, you spend a lot of time emulating the vertical MVC slice client-side and must pull in tons of external libraries. To recap, all this boilerplate effort:
- Configure your routes with react router
- Pick a global state management library
- Sync your model semantics within your client-side store with those defined in the server-side model (DB)
- Configure a query/mutation management library or roll your own
- Form management library
And so on. You get the picture. That's not to mention all the time spent wiring up your compoennts to handle the data life cycle updates in a UX-friendly fashion (loaders, infinite scrolling, nested components)... And that's just client-side.
It's not uncommon to have a separate server-side API with a similar but distinct set of controllers over your model. This may very well be managed by a separate team in larger organizations. A non-trivial amount of effort goes into keeping your semantics in sync across teams.
Remix is like a server-side, batteries-included flavor of React. Indeed, it's built on top of React + React Router. The phrase "batteries-included" is misleading though. It gives me flashbacks of days yore when I used MS Windows and there would be endless bloatware pre-packaged with the OS.
Remix achieves the batteries-included effect without the feeling of bloat and kludginess. How? Because it was designed around those batteries, from the ground up, using first principles.
By coupling the view and controller on the server and introducing clean primitives like actions and loaders, Remix gives me HTMX vibes but packaged in react dev-friendly way.
So far, I'm impressed.