Skip to content

Commit b2b38e8

Browse files
Brickloutimdorr
andauthored
Add a warning about using React 19 meta API instead of meta function. (#13586)
* Add a warning about using React 19 meta API instead of meta function. * Add username to contributors.yml * Update docs/start/framework/route-module.md * Update docs/start/framework/route-module.md --------- Co-authored-by: Tim Dorr <timdorr@users.noreply.github.com>
1 parent 3046093 commit b2b38e8

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,4 @@
388388
- yuleicul
389389
- zeromask1337
390390
- zheng-chuang
391+
- Bricklou

docs/start/framework/route-module.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,30 @@ export default function Root() {
311311

312312
Route meta defines meta tags to be rendered in the `<head>` of the document.
313313

314+
<docs-warning>
315+
316+
Since React 19, [using the built-in `<meta>` element](https://react.dev/reference/react-dom/components/meta) is recommended over the use of the route module's `meta` export.
317+
318+
Here is an example of how to use it and the `<title>` element:
319+
320+
```tsx
321+
export default function MyRoute() {
322+
return (
323+
<div>
324+
<title>Very cool app</title>
325+
<meta property="og:title" content="Very cool app" />
326+
<meta
327+
name="description"
328+
content="This app is the best"
329+
/>
330+
{/* The rest of your route content... */}
331+
</div>
332+
);
333+
}
334+
```
335+
336+
</docs-warning>
337+
314338
```tsx
315339
export function meta() {
316340
return [

0 commit comments

Comments
 (0)