Remix v2 Has a Free Framework That Makes React Server-Side Rendering Actually Enjoyable
Source: Dev.to
What Changed in v2
| Feature | Remix v1 | Remix v2 |
|---|---|---|
| Routing | file convention v1 | flat routes (v2 convention) |
| Dev server | Custom | Vite |
| CSS | Custom imports | Vite CSS |
| Meta | Object | Function |
| Error boundary | CatchBoundary + ErrorBoundary | Single ErrorBoundary |
Quick Start
npx create-remix@latest my-app
cd my-app && npm run devNested Routes with Data Loading
// app/routes/posts.$postId.tsx
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
export async function loader({ params }: LoaderFunctionArgs) {
const post = await db.post.findUnique({ where: { id: params.postId } });
if (!post) throw new Response("Not Found", { status: 404 });
return json({ post });
}
export default function Post() {
const { post } = useLoaderData();
return (
<>
<h2>{post.title}</h2>
<p>{post.content}</p>
</>
);
}Actions (Server‑Side Form Handling)
import { ActionFunctionArgs, redirect } from "@remix-run/node";
export async function action({ request }: ActionFunctionArgs) {
const formData = await request.formData();
const title = formData.get("title") as string;
await db.post.create({ data: { title } });
return redirect("/posts");
}
export default function NewPost() {
return (
<>
Create
</>
);
}No useState, no onSubmit handler, and no manual fetch calls—forms work out of the box with progressive enhancement.
Error Boundaries
import { useRouteError, isRouteErrorResponse } from "@remix-run/react";
export function ErrorBoundary() {
const error = useRouteError();
if (isRouteErrorResponse(error)) {
return (
<div>
{error.status}: {error.data}
</div>
);
}
return <div>Something went wrong</div>;
}A single boundary handles both expected (e.g., 404) and unexpected errors per route.
Why Remix Over Next.js
- Nested routes → parallel data loading, no waterfall effect.
- Forms work without JavaScript → full progressive enhancement.
- Standard Web APIs (Request, Response, FormData) are used directly.
- Simpler mental model than React Server Components (RSC).
The Bottom Line
Remix v2 on Vite is fast, simple, and web‑standards‑first. If you want React SSR without the Next.js complexity, this is it.
Need to automate data collection or build custom scrapers? Check out my Apify actors for ready‑made tools, or email spinov001@gmail.com for custom solutions.