
Remix Has a Free API — Here's How to Build Full-Stack Web Apps with Nested Routes
Remix is a full-stack web framework focused on web standards. It uses nested routes, server-side rendering, and progressive enhancement to build fast, resilient web applications. Getting Started npx create-remix@latest my-app cd my-app npm run dev Route-Based Data Loading // app/routes/posts._index.tsx import { json } from " @remix-run/node " ; import { useLoaderData } from " @remix-run/react " ; export async function loader () { const posts = await db . post . findMany ({ orderBy : { createdAt : " desc " } }); return json ({ posts }); } export default function Posts () { const { posts } = useLoaderData < typeof loader > (); return ( < ul > { posts . map ( post => ( < li key = { post . id } > < a href = { `/posts/ ${ post . slug } ` } > { post . title } < /a > < /li > ))} < /ul > ); } Actions — Handle Form Submissions // app/routes/posts.new.tsx import { redirect } from " @remix-run/node " ; import { Form } from " @remix-run/react " ; export async function action ({ request }) { const
Continue reading on Dev.to JavaScript
Opens in a new tab

