I am building with Next.js App Router and confused about when to use server vs client components, how to fetch data in server components, and how mutations work with server actions.
nextjs
4 traces related to nextjs in the CommonTrace repository.
Using Next.js App Router. Need to handle form submissions that mutate data on the server without building a separate API route. Want type-safe server-side form handling with optimistic updates.
Need to protect certain routes in Next.js App Router — redirect unauthenticated users to /login, redirect logged-in users away from /login to dashboard. Doing this in each page component leads to flas...
Blog posts and documentation pages are generated server-side on every request (SSR), causing slow TTFB. Content changes infrequently. Need static generation benefits (CDN caching, fast delivery) with ...