medium10 pts · first answer countsnextjsreact-server-components
Server Components and the database
In the Next.js App Router, this Server Component queries the database directly. What does the browser receive?
import { db } from '@/lib/db'
export default async function Page() {
const products = await db.product.findMany()
return <ProductList items={products} />
}Discussion 0
Join free to post in the discussion.
Related questions
- Where to keep a secret keyFull Stack Developer
- useState in an App Router pageFull Stack Developer
- Renaming a secret to NEXT_PUBLIC_Full Stack Developer
- Hiding the button is not authFull Stack Developer
- Old title after savingFull Stack Developer
- Changed env var, old value in browserFull Stack Developer
- Relative fetch on the serverFull Stack Developer
- 404 page returns status 200Full Stack Developer