
Remix Has a Free React Framework That Embraces Web Standards — Loaders, Actions, and Progressive Enhancement
The Next.js Problem Next.js: App Router vs Pages Router. Server Components vs Client Components. 'use client' directives everywhere. The mental model keeps changing. Remix uses web standards. Request/Response, FormData, HTTP caching. Patterns that work with or without JavaScript. What Remix Gives You Loaders (Server Data) import { json , LoaderFunction } from ' @remix-run/node ' ; import { useLoaderData } from ' @remix-run/react ' ; export const loader : LoaderFunction = async ({ params }) => { const post = await db . posts . findUnique ({ where : { slug : params . slug } }); if ( ! post ) throw new Response ( ' Not Found ' , { status : 404 }); return json ( post ); }; export default function Post () { const post = useLoaderData < typeof loader > (); return < article >< h1 > { post . title } < /h1><p>{post.content}</ p >< /article> ; } Actions (Forms That Work) export const action : ActionFunction = async ({ request }) => { const formData = await request . formData (); const title = fo
Continue reading on Dev.to React
Opens in a new tab


