React 19 supports <title>, <meta>, <link> directly in components.
Code:
1function BlogPost({ post }) {2 return (3 <article>4 <title>{post.title} | Blog</title>5 <meta name="description" content={post.summary} />6 <meta property="og:title" content={post.title} />7 <link rel="canonical" href={`/posts/${post.id}`} />8 <h1>{post.title}</h1>9 <p>{post.content}</p>10 </article>11 );12}
Benefits:
Stylesheets:
1<link rel="stylesheet" href="styles.css" precedence="default" />
Key points:
<head>