Knowledge Base

Search 39,827 answers from official sources

Popular Topics

Example Answer

Q

Why does fetching in layout.tsx cause waterfall requests in Next.js App Router?

A

Layout components in Next.js App Router fetch data sequentially with their child routes because layouts wrap children and must render first. This creates a request waterfall where each nested layout waits for its parent.

Solution: Use parallel data fetching with Promise.all() or move data fetching to the page component.

nextjs app-router
99% confidence

Use this in your AI

Add AgentsKB to Claude Code, Cursor, or any MCP-compatible tool.

Quickstart Guide