What is different folder structure between Pages Router and App Router #70379
Unanswered
Patrix2001
asked this question in
Help
Replies: 2 comments
-
It is using App Router. The top level folder is |
Beta Was this translation helpful? Give feedback.
0 replies
-
You are mixing a few things here.
Rather, you have to get the data for the page as you render the component: Extracted here for visibility: export default async function Page() {
const pages = await getAllPages();
return (
<Section>
<Container>
<h1>Pages</h1>
<h2>All Pages</h2>
<div className="grid">
{pages.map((page: any) => (
<Link key={page.id} href={`pages/${page.slug}`}>
{page.title.rendered}
</Link>
))}
</div>
</Container>
</Section>
);
} That's the whole point of App Router. So to answer your question, the example there is using App Router, where you can use Server Components, which enable you to fetch the data as part of your render pass. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I check one from template of Next.Js https://vercel.com/new/templates/next.js/nextjs-wordpress-headless-cms
is it using Pages Router or App Router?
When I configure page tsx for enable Incremental Static Regeneration (ISR), got this error
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions