Skip to content

Add a warning about using React 19 meta API instead of meta function. #13586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,4 @@
- yuleicul
- zeromask1337
- zheng-chuang
- Bricklou
24 changes: 24 additions & 0 deletions docs/start/framework/route-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,30 @@ export default function Root() {

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

<docs-warning>

Since the version 19 of React, the use of the built-in `<meta>` support is recommended other the use of the `meta` function. You can find the documentation [here](https://react.dev/reference/react-dom/components/meta).

Here is an snippet code equivalent of the example below:

```tsx
export default function MyRoute() {
return (
<div>
<title>Very cool app</title>
<meta property="og:title" content="Very cool app" />
<meta
name="description"
content="This app is the best"
/>
{/* The rest of your route content... */}
</div>
);
}
```

</docs-warning>

```tsx
export function meta() {
return [
Expand Down