
Remix v2 Has a Free Framework: Full-Stack Web Apps with Nested Routes and Server-Side Data Loading
Why Remix v2? Remix v2 is a full-stack web framework built on React Router that embraces web standards. Nested routes, server-side loaders, and progressive enhancement make it a serious alternative to Next.js - especially when you want your app to work even without JavaScript. Quick Start npx create-remix@latest my-app cd my-app npm run dev Loaders: Server-Side Data Fetching // app/routes/posts.tsx import type { LoaderFunctionArgs } from ' @remix-run/node ' ; import { json } from ' @remix-run/node ' ; import { useLoaderData } from ' @remix-run/react ' ; export async function loader ({ request }: LoaderFunctionArgs ) { const url = new URL ( request . url ); const query = url . searchParams . get ( ' q ' ) || '' ; const posts = await db . posts . findMany ({ where : { title : { contains : query } }, orderBy : { createdAt : ' desc ' }, take : 20 , }); return json ({ posts , query }); } export default function Posts () { const { posts , query } = useLoaderData < typeof loader > (); return
Continue reading on Dev.to React
Opens in a new tab



