Next.js Hybrid SPA
Create a client-heavy section within an App Router app with clear server/client boundaries.
When to Use
- •SPA-like interactions within a Next.js app
- •Client-driven state and routing behavior
- •Partial hydration for interactive widgets
Inputs
- •Route segment
- •Interactive components list
- •Client-side state requirements
Instructions
- •Keep the route entry as a Server Component.
- •Move interactive parts to Client Components.
- •Use
useTransitionfor non-urgent updates. - •Use
useSearchParams/useRouteronly in Client Components. - •Avoid
ssr: falseunless strictly necessary.
Output
- •Hybrid page with server shell and client islands.