Skip to content

Commit d2bffdf

Browse files
authored
docs(start/framework/route-module): clarify the behaviour of multiple meta functions (#13642)
1 parent cb4450d commit d2bffdf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@
382382
- willsawyerrrr
383383
- willsmithte
384384
- wkovacs64
385+
- woodywoodsta
385386
- xavier-lc
386387
- xcsnowcity
387388
- xdaxer

docs/start/framework/route-module.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ export default function Root() {
309309

310310
## `meta`
311311

312-
Route meta defines meta tags to be rendered in the `<head>` of the document.
312+
Route meta defines meta tags to be rendered in the `<Meta />` component, usually placed in the `<head>`.
313313

314-
```tsx
314+
```tsx filename=app/product.tsx
315315
export function meta() {
316316
return [
317317
{ title: "Very cool app" },
@@ -326,10 +326,7 @@ export function meta() {
326326
];
327327
}
328328
```
329-
330-
All routes' meta will be aggregated and rendered through the `<Meta />` component, usually rendered in your app root:
331-
332-
```tsx
329+
```tsx filename=app/root.tsx
333330
import { Meta } from "react-router";
334331

335332
export default function Root() {
@@ -345,6 +342,8 @@ export default function Root() {
345342
}
346343
```
347344

345+
The meta of the last matching route is used, allowing you to override parent routes' meta. It's important to note that the entire meta descriptor array is replaced, not merged. This gives you the flexibility to build your own meta composition logic across pages at different levels.
346+
348347
**See also**
349348

350349
- [`meta` params][meta-params]

0 commit comments

Comments
 (0)