docs: fix code examples in getting-started guides (#93273)
### What?
Fix three broken code examples in the Getting Started section.
### Why?
Per the contribution guide, code blocks should contain a minimum working
example that can be copied and pasted. These examples have bugs that
would cause runtime errors or incorrect behavior:
1. `02-project-structure.mdx`: Extra comma in App Icons table —
`apple-icon` row has `.jpg` `.jpeg`, `.png` while all other rows use
space-separated extensions without commas.
2. `03-layouts-and-pages.mdx`: `Post` component has an unused `post`
prop — the component fetches and renders all posts internally via
`getPosts()`, so the prop is never referenced. Removed the unused prop,
renamed to `Posts` to match its actual behavior, and added the missing
`import { getPosts } from '@/lib/posts'`.
3. `04-linking-and-navigating.mdx`: JSX `Layout` function is missing `{
children }` in its parameter list, causing `ReferenceError: children is
not defined` at runtime. The TSX version is correct.
### How?
- Remove stray comma from App Icons table
- Remove unused `post` prop from `Post` component, rename to `Posts`,
add missing import
- Add `{ children }` destructuring to JSX `Layout` function signature
Closes #93272
---------
Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
Showing
Please
register
or
sign in
to comment